]> git.saurik.com Git - apt.git/blobdiff - methods/http_main.cc
don't try pipelining if server closes connections
[apt.git] / methods / http_main.cc
index fa183ddb3ce7119f5b57181886dfcaf28fb4ed48..1e56044b72233dc7789d896847f336d123bfe365 100644 (file)
@@ -5,11 +5,13 @@
 
 #include "http.h"
 
-int main()
+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);
-
-   return HttpMethod().Loop();
+   std::string Binary = flNotDir(argv[0]);
+   if (Binary.find('+') == std::string::npos && Binary != "http")
+      Binary.append("+http");
+   return HttpMethod(std::move(Binary)).Loop();
 }