summaryrefslogtreecommitdiff
path: root/methods/http_main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'methods/http_main.cc')
-rw-r--r--methods/http_main.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/methods/http_main.cc b/methods/http_main.cc
new file mode 100644
index 000000000..1e56044b7
--- /dev/null
+++ b/methods/http_main.cc
@@ -0,0 +1,17 @@
+#include <config.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/error.h>
+#include <signal.h>
+
+#include "http.h"
+
+int main(int, const char *argv[])
+{
+ // ignore SIGPIPE, this can happen on write() if the socket
+ // closes the connection (this is dealt with via ServerDie())
+ signal(SIGPIPE, SIG_IGN);
+ std::string Binary = flNotDir(argv[0]);
+ if (Binary.find('+') == std::string::npos && Binary != "http")
+ Binary.append("+http");
+ return HttpMethod(std::move(Binary)).Loop();
+}