X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b53c9cea2902572822bbbece5bac236c1bbf846e..ebdb6f1810a20ac240b5b2192dc2e6532ff149d2:/methods/http.h diff --git a/methods/http.h b/methods/http.h index da6139b02..b7341f5f8 100644 --- a/methods/http.h +++ b/methods/http.h @@ -12,7 +12,6 @@ #define APT_HTTP_H #include -#include #include #include @@ -68,7 +67,7 @@ class CircleBuf // Read data in bool Read(int Fd); - bool Read(std::string Data); + bool Read(std::string const &Data); // Write data out bool Write(int Fd); @@ -87,7 +86,7 @@ class CircleBuf // Dump everything void Stats(); - CircleBuf(unsigned long long Size); + CircleBuf(HttpMethod const * const Owner, unsigned long long Size); ~CircleBuf(); }; @@ -104,16 +103,17 @@ struct HttpServerState: public ServerState virtual bool WriteResponse(std::string const &Data) APT_OVERRIDE; public: - virtual void Reset() APT_OVERRIDE { ServerState::Reset(); ServerFd = -1; }; + virtual void Reset(bool const Everything = true) APT_OVERRIDE; virtual bool RunData(FileFd * const File) APT_OVERRIDE; + virtual bool RunDataToDevNull() APT_OVERRIDE; virtual bool Open() APT_OVERRIDE; virtual bool IsOpen() APT_OVERRIDE; virtual bool Close() APT_OVERRIDE; virtual bool InitHashes(HashStringList const &ExpectedHashes) APT_OVERRIDE; virtual Hashes * GetHashes() APT_OVERRIDE; - virtual bool Die(FileFd &File) APT_OVERRIDE; + virtual bool Die(FileFd * const File) APT_OVERRIDE; virtual bool Flush(FileFd * const File) APT_OVERRIDE; virtual bool Go(bool ToFile, FileFd * const File) APT_OVERRIDE; @@ -126,10 +126,9 @@ class HttpMethod : public ServerMethod public: virtual void SendReq(FetchItem *Itm) APT_OVERRIDE; - virtual bool Configuration(std::string Message) APT_OVERRIDE; - - virtual ServerState * CreateServerState(URI uri) APT_OVERRIDE; + virtual std::unique_ptr CreateServerState(URI const &uri) APT_OVERRIDE; virtual void RotateDNS() APT_OVERRIDE; + virtual DealWithHeadersResult DealWithHeaders(FetchResult &Res) APT_OVERRIDE; protected: std::string AutoDetectProxyCmd; @@ -137,11 +136,7 @@ class HttpMethod : public ServerMethod public: friend struct HttpServerState; - HttpMethod() : ServerMethod("1.2",Pipeline | SendConfig) - { - File = 0; - Server = 0; - }; + explicit HttpMethod(std::string &&pProg); }; #endif