X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/8f3ba4e8708cb72be19dacc2af4f601ee5fea292..8d01b9d692f49309235e710b79937baf605fda3d:/methods/http.h diff --git a/methods/http.h b/methods/http.h index 08823d1b1..7a3ccda54 100644 --- a/methods/http.h +++ b/methods/http.h @@ -11,14 +11,15 @@ #ifndef APT_HTTP_H #define APT_HTTP_H -#define MAXLEN 360 +#include -#include +#include using std::cout; using std::endl; class HttpMethod; +class Hashes; class CircleBuf { @@ -80,7 +81,7 @@ class CircleBuf void Stats(); CircleBuf(unsigned long long Size); - ~CircleBuf() {delete [] Buf; delete Hash;}; + ~CircleBuf(); }; struct ServerState @@ -89,7 +90,7 @@ struct ServerState unsigned int Major; unsigned int Minor; unsigned int Result; - char Code[MAXLEN]; + char Code[360]; // These are some statistics from the last parsed header lines unsigned long long Size; @@ -114,9 +115,10 @@ struct ServerState bool HeaderLine(std::string Line); 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;}; + 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; ServerFd = -1; + Pipeline = true;}; /** \brief Result of the header acquire */ enum RunHeadersResult {