X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/4fc6b7570c3e97b65c118b58cdf6729fa94c9b03..30c8107e9c56d7d78dcf9136f94aeed9d631dfb3:/methods/server.h diff --git a/methods/server.h b/methods/server.h index 8d7d33ee6..5de7686d9 100644 --- a/methods/server.h +++ b/methods/server.h @@ -17,6 +17,7 @@ #include #include #include +#include using std::cout; using std::endl; @@ -106,9 +107,9 @@ struct ServerState class ServerMethod : public pkgAcqMethod { protected: - virtual bool Fetch(FetchItem *); + virtual bool Fetch(FetchItem *) APT_OVERRIDE; - ServerState *Server; + std::unique_ptr Server; std::string NextURI; FileFd *File; @@ -146,16 +147,16 @@ class ServerMethod : public pkgAcqMethod static time_t FailTime; static APT_NORETURN void SigTerm(int); - virtual bool Configuration(std::string Message); + virtual bool Configuration(std::string Message) APT_OVERRIDE; virtual bool Flush() { return Server->Flush(File); }; int Loop(); virtual void SendReq(FetchItem *Itm) = 0; - virtual ServerState * CreateServerState(URI uri) = 0; + virtual std::unique_ptr CreateServerState(URI const &uri) = 0; virtual void RotateDNS() = 0; - ServerMethod(const char *Ver,unsigned long Flags = 0) : pkgAcqMethod(Ver, Flags), Server(NULL), File(NULL), PipelineDepth(10), AllowRedirect(false), Debug(false) {}; + ServerMethod(const char *Ver,unsigned long Flags = 0); virtual ~ServerMethod() {}; };