summaryrefslogtreecommitdiff
path: root/methods/http.h
diff options
context:
space:
mode:
Diffstat (limited to 'methods/http.h')
-rw-r--r--methods/http.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/methods/http.h b/methods/http.h
index c79a6454e..7a763675c 100644
--- a/methods/http.h
+++ b/methods/http.h
@@ -13,11 +13,13 @@
#include <apt-pkg/strutl.h>
+#include <iostream>
+#include <memory>
#include <string>
#include <sys/time.h>
-#include <iostream>
#include "basehttp.h"
+#include "connect.h"
using std::cout;
using std::endl;
@@ -66,11 +68,12 @@ class CircleBuf
unsigned long long TotalWriten;
// Read data in
- bool Read(int Fd);
+ bool Read(std::unique_ptr<MethodFd> const &Fd);
bool Read(std::string const &Data);
// Write data out
- bool Write(int Fd);
+ bool Write(std::unique_ptr<MethodFd> const &Fd);
+ bool Write(std::string &Data);
bool WriteTillEl(std::string &Data,bool Single = false);
// Control the write limit
@@ -90,12 +93,14 @@ class CircleBuf
~CircleBuf();
};
+bool UnwrapHTTPConnect(std::string To, int Port, URI Proxy, std::unique_ptr<MethodFd> &Fd, unsigned long Timeout, aptMethod *Owner);
+
struct HttpServerState: public ServerState
{
// This is the connection itself. Output is data FROM the server
CircleBuf In;
CircleBuf Out;
- int ServerFd;
+ std::unique_ptr<MethodFd> ServerFd;
protected:
virtual bool ReadHeaderLines(std::string &Data) APT_OVERRIDE;