summaryrefslogtreecommitdiff
path: root/methods/http.h
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-08-26 19:08:37 -0700
committerMichael Vogt <mvo@debian.org>2014-08-26 19:08:37 -0700
commitdcd5856b11c685ca6d4629212d2978ce196ea65c (patch)
tree932d7934b144353010d85eff5eb76324b39554c4 /methods/http.h
parent80624be7c54aec6ed98ee254366155024fca1a71 (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/http.h')
-rw-r--r--methods/http.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/methods/http.h b/methods/http.h
index 5406ce4a7..c98fe8e5f 100644
--- a/methods/http.h
+++ b/methods/http.h
@@ -63,6 +63,8 @@ class CircleBuf
public:
Hashes *Hash;
+ // total amount of data that got written so far
+ unsigned long long TotalWriten;
// Read data in
bool Read(int Fd);
@@ -81,8 +83,8 @@ class CircleBuf
bool ReadSpace() const {return Size - (InP - OutP) > 0;};
bool WriteSpace() const {return InP - OutP > 0;};
- // Dump everything
void Reset();
+ // Dump everything
void Stats();
CircleBuf(unsigned long long Size);