]> git.saurik.com Git - apt.git/blobdiff - methods/server.h
tests: don't do boundless string compares with data()
[apt.git] / methods / server.h
index 3f6502432e5b11789913948cd37d93d8a3ccc32c..1d114354f2a85ae7149b454111b1240d78746a9c 100644 (file)
@@ -12,7 +12,6 @@
 #define APT_SERVER_H
 
 #include <apt-pkg/strutl.h>
-#include <apt-pkg/acquire-method.h>
 #include "aptmethod.h"
 
 #include <time.h>
@@ -92,13 +91,14 @@ struct ServerState
 
    /** \brief Transfer the data from the socket */
    virtual bool RunData(FileFd * const File) = 0;
+   virtual bool RunDataToDevNull() = 0;
 
    virtual bool Open() = 0;
    virtual bool IsOpen() = 0;
    virtual bool Close() = 0;
    virtual bool InitHashes(HashStringList const &ExpectedHashes) = 0;
    virtual Hashes * GetHashes() = 0;
-   virtual bool Die(FileFd &File) = 0;
+   virtual bool Die(FileFd * const File) = 0;
    virtual bool Flush(FileFd * const File) = 0;
    virtual bool Go(bool ToFile, FileFd * const File) = 0;
 
@@ -141,7 +141,7 @@ class ServerMethod : public aptMethod
       TRY_AGAIN_OR_REDIRECT
    };
    /** \brief Handle the retrieved header data */
-   DealWithHeadersResult DealWithHeaders(FetchResult &Res);
+   virtual DealWithHeadersResult DealWithHeaders(FetchResult &Res);
 
    // In the event of a fatal signal this file will be closed and timestamped.
    static std::string FailFile;
@@ -156,8 +156,11 @@ class ServerMethod : public aptMethod
    virtual void SendReq(FetchItem *Itm) = 0;
    virtual std::unique_ptr<ServerState> CreateServerState(URI const &uri) = 0;
    virtual void RotateDNS() = 0;
+   virtual bool Configuration(std::string Message) APT_OVERRIDE;
 
-   ServerMethod(char const * const Binary, char const * const Ver,unsigned long const Flags);
+   bool AddProxyAuth(URI &Proxy, URI const &Server) const;
+
+   ServerMethod(std::string &&Binary, char const * const Ver,unsigned long const Flags);
    virtual ~ServerMethod() {};
 };