diff options
Diffstat (limited to 'methods/http.h')
-rw-r--r-- | methods/http.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/methods/http.h b/methods/http.h index aa96c6810..c47d7184a 100644 --- a/methods/http.h +++ b/methods/http.h @@ -23,29 +23,29 @@ class HttpMethod; class CircleBuf { unsigned char *Buf; - unsigned long Size; - unsigned long InP; - unsigned long OutP; + unsigned long long Size; + unsigned long long InP; + unsigned long long OutP; string OutQueue; - unsigned long StrPos; - unsigned long MaxGet; + unsigned long long StrPos; + unsigned long long MaxGet; struct timeval Start; - static unsigned long BwReadLimit; - static unsigned long BwTickReadData; + static unsigned long long BwReadLimit; + static unsigned long long BwTickReadData; static struct timeval BwReadTick; static const unsigned int BW_HZ; - unsigned long LeftRead() + unsigned long long LeftRead() const { - unsigned long Sz = Size - (InP - OutP); + unsigned long long Sz = Size - (InP - OutP); if (Sz > Size - (InP%Size)) Sz = Size - (InP%Size); return Sz; } - unsigned long LeftWrite() + unsigned long long LeftWrite() const { - unsigned long Sz = InP - OutP; + unsigned long long Sz = InP - OutP; if (InP > MaxGet) Sz = MaxGet - OutP; if (Sz > Size - (OutP%Size)) @@ -67,19 +67,19 @@ class CircleBuf bool WriteTillEl(string &Data,bool Single = false); // Control the write limit - void Limit(long Max) {if (Max == -1) MaxGet = 0-1; else MaxGet = OutP + Max;} - bool IsLimit() {return MaxGet == OutP;}; - void Print() {cout << MaxGet << ',' << OutP << endl;}; + void Limit(long long Max) {if (Max == -1) MaxGet = 0-1; else MaxGet = OutP + Max;} + bool IsLimit() const {return MaxGet == OutP;}; + void Print() const {cout << MaxGet << ',' << OutP << endl;}; // Test for free space in the buffer - bool ReadSpace() {return Size - (InP - OutP) > 0;}; - bool WriteSpace() {return InP - OutP > 0;}; + bool ReadSpace() const {return Size - (InP - OutP) > 0;}; + bool WriteSpace() const {return InP - OutP > 0;}; // Dump everything void Reset(); void Stats(); - CircleBuf(unsigned long Size); + CircleBuf(unsigned long long Size); ~CircleBuf() {delete [] Buf; delete Hash;}; }; @@ -92,8 +92,8 @@ struct ServerState char Code[MAXLEN]; // These are some statistics from the last parsed header lines - unsigned long Size; - signed long StartPos; + unsigned long long Size; + signed long long StartPos; time_t Date; bool HaveContent; enum {Chunked,Stream,Closes} Encoding; @@ -113,7 +113,7 @@ struct ServerState URI ServerName; bool HeaderLine(string Line); - bool Comp(URI Other) {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;}; + bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;}; void Reset() {Major = 0; Minor = 0; Result = 0; Size = 0; StartPos = 0; Encoding = Closes; time(&Date); ServerFd = -1; Pipeline = true;}; |