From 5666084ecfe140aaa3f89388de557c2f875b4244 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 28 Jun 2017 10:55:08 +0200 Subject: methods: connect: Switch from int fds to new MethodFd Use std::unique_ptr everywhere we used an integer-based file descriptor before. This allows us to implement stuff like TLS support easily. Gbp-Dch: ignore --- methods/http.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'methods/http.h') 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 +#include +#include #include #include -#include #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 const &Fd); bool Read(std::string const &Data); // Write data out - bool Write(int Fd); + bool Write(std::unique_ptr 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 ServerFd; protected: virtual bool ReadHeaderLines(std::string &Data) APT_OVERRIDE; -- cgit v1.2.3