X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=httpinput.h;h=0c3b5344a5ccecc29341d7c52098cc545722fa65;hb=HEAD;hp=4ee5ede87542866182133f23b40b2bb12b8735c7;hpb=20e85bd6901355cc40a6cfb4c0deb7232d9aa63f;p=cubemap diff --git a/httpinput.h b/httpinput.h index 4ee5ede..0c3b534 100644 --- a/httpinput.h +++ b/httpinput.h @@ -2,6 +2,7 @@ #define _HTTPINPUT_H 1 #include +#include #include #include #include @@ -12,6 +13,8 @@ class InputProto; +// Despite the name, covers input over both HTTP and pipes, both typically +// wrapped in Metacube. class HTTPInput : public Input { public: HTTPInput(const std::string &url, Input::Encoding encoding); @@ -35,6 +38,10 @@ private: // Open a socket that connects to the given host and port. Does DNS resolving. int lookup_and_connect(const std::string &host, const std::string &port); + // Open a child process with the given command line (given to /bin/sh). + // Returns a pipe to its standard output. + int open_child_process(const std::string &cmdline); + // Parses a HTTP response. Returns false if it not a 200. bool parse_response(const std::string &response); @@ -93,6 +100,9 @@ private: // The socket we are downloading on (or -1). int sock = -1; + // pid of the child process (or -1). + pid_t child_pid = -1; + // Mutex protecting . mutable std::mutex stats_mutex;