http_main.cc 498 B

123456789101112131415161718
  1. #include <config.h>
  2. #include <apt-pkg/fileutl.h>
  3. #include <apt-pkg/error.h>
  4. #include <signal.h>
  5. #include "http.h"
  6. int main(int, const char *argv[])
  7. {
  8. // ignore SIGPIPE, this can happen on write() if the socket
  9. // closes the connection (this is dealt with via ServerDie())
  10. signal(SIGPIPE, SIG_IGN);
  11. std::string Binary = flNotDir(argv[0]);
  12. if (Binary.find('+') == std::string::npos && Binary != "http")
  13. Binary.append("+http");
  14. return HttpMethod(std::move(Binary)).Loop();
  15. }