diff options
author | Michael Vogt <mvo@debian.org> | 2014-08-26 19:08:37 -0700 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-08-26 19:08:37 -0700 |
commit | dcd5856b11c685ca6d4629212d2978ce196ea65c (patch) | |
tree | 932d7934b144353010d85eff5eb76324b39554c4 /methods/server.h | |
parent | 80624be7c54aec6ed98ee254366155024fca1a71 (diff) |
Pass ExpectedSize to tthe backend method
This ensures that we can stop downloading if the server send
too much data by accident (or by a malicious attempt)
Diffstat (limited to 'methods/server.h')
-rw-r--r-- | methods/server.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/methods/server.h b/methods/server.h index 5299b3954..0d7333140 100644 --- a/methods/server.h +++ b/methods/server.h @@ -49,6 +49,8 @@ struct ServerState URI Proxy; unsigned long TimeOut; + unsigned long long ExpectedSize; + protected: ServerMethod *Owner; @@ -73,7 +75,7 @@ struct ServerState 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; StartPos = 0; Encoding = Closes; time(&Date); HaveContent = false; - State = Header; Persistent = false; Pipeline = true;}; + State = Header; Persistent = false; Pipeline = true; ExpectedSize = 0;}; virtual bool WriteResponse(std::string const &Data) = 0; /** \brief Transfer the data from the socket */ |