summaryrefslogtreecommitdiff
path: root/methods/http.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-06-28 10:55:08 +0200
committerJulian Andres Klode <jak@debian.org>2017-06-28 15:52:38 +0200
commit5666084ecfe140aaa3f89388de557c2f875b4244 (patch)
tree49bae823b0473e72d58db10033de2329a71d4c80 /methods/http.h
parentb4afd84a59578965120f175b410ea325d60bcb58 (diff)
methods: connect: Switch from int fds to new MethodFd
Use std::unique_ptr<MethodFd> everywhere we used an integer-based file descriptor before. This allows us to implement stuff like TLS support easily. Gbp-Dch: ignore
Diffstat (limited to 'methods/http.h')
-rw-r--r--methods/http.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/methods/http.h b/methods/http.h
index c79a6454e..3336fb780 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,11 @@ 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 WriteTillEl(std::string &Data,bool Single = false);
// Control the write limit
@@ -95,7 +97,7 @@ 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;