summaryrefslogtreecommitdiff
path: root/methods/server.h
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2015-05-22 17:01:03 +0200
committerMichael Vogt <mvo@ubuntu.com>2015-05-22 17:01:03 +0200
commit4fc6b7570c3e97b65c118b58cdf6729fa94c9b03 (patch)
treef952bb728b9c23f1eebc8f1a87f527ed7c9b0b36 /methods/server.h
parent6bf93605fdb8e858d3f0a79a124c1d39f760094d (diff)
parent65759e00eff0513c34f584b99420b72fe0e5073e (diff)
Merge branch 'debian/sid' into debian/experimental
Conflicts: apt-pkg/pkgcache.h debian/changelog methods/https.cc methods/server.cc test/integration/test-apt-download-progress
Diffstat (limited to 'methods/server.h')
-rw-r--r--methods/server.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/methods/server.h b/methods/server.h
index 1b1f754a3..8d7d33ee6 100644
--- a/methods/server.h
+++ b/methods/server.h
@@ -34,9 +34,16 @@ struct ServerState
char Code[360];
// These are some statistics from the last parsed header lines
- unsigned long long Size; // size of the usable content (aka: the file)
- unsigned long long JunkSize; // size of junk content (aka: server error pages)
+
+ // total size of the usable content (aka: the file)
+ unsigned long long TotalFileSize;
+ // size we actually download (can be smaller than Size if we have partial content)
+ unsigned long long DownloadSize;
+ // size of junk content (aka: server error pages)
+ unsigned long long JunkSize;
+ // The start of the data (for partial content)
unsigned long long StartPos;
+
time_t Date;
bool HaveContent;
enum {Chunked,Stream,Closes} Encoding;
@@ -75,7 +82,7 @@ struct ServerState
bool AddPartialFileToHashes(FileFd &File);
bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;};
- virtual void Reset() {Major = 0; Minor = 0; Result = 0; Code[0] = '\0'; Size = 0; JunkSize = 0;
+ virtual void Reset() {Major = 0; Minor = 0; Result = 0; Code[0] = '\0'; TotalFileSize = 0; JunkSize = 0;
StartPos = 0; Encoding = Closes; time(&Date); HaveContent = false;
State = Header; Persistent = false; Pipeline = true; MaximumSize = 0;};
virtual bool WriteResponse(std::string const &Data) = 0;