busybox: Update from 1.26.2 to 1.27.1
[termux-packages] / packages / busybox / networking-httpd.c.patch
similarity index 70%
rename from packages/busybox/httpd.patch
rename to packages/busybox/networking-httpd.c.patch
index 2d7b5bb..8f36fbb 100644 (file)
@@ -1,7 +1,7 @@
-diff -u -r ../busybox-1.22.1/networking/httpd.c ./networking/httpd.c
---- ../busybox-1.22.1/networking/httpd.c       2014-01-09 19:15:44.000000000 +0100
-+++ ./networking/httpd.c       2014-01-20 08:47:37.000000000 +0100
-@@ -112,7 +112,7 @@
+diff -u -r ../busybox-1.27.1/networking/httpd.c ./networking/httpd.c
+--- ../busybox-1.27.1/networking/httpd.c       2017-07-06 15:14:57.000000000 +0000
++++ ./networking/httpd.c       2017-07-24 23:41:41.454424822 +0000
+@@ -234,7 +234,7 @@
  //usage:     "\n      -i              Inetd mode"
  //usage:     "\n      -f              Don't daemonize"
  //usage:     "\n      -v[v]           Verbose"
@@ -10,7 +10,7 @@ diff -u -r ../busybox-1.22.1/networking/httpd.c ./networking/httpd.c
  //usage:      IF_FEATURE_HTTPD_SETUID(
  //usage:     "\n      -u USER[:GRP]   Set uid/gid after binding to port")
  //usage:      IF_FEATURE_HTTPD_BASIC_AUTH(
-@@ -371,7 +371,7 @@
+@@ -491,7 +491,7 @@
        SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
        IF_FEATURE_HTTPD_BASIC_AUTH(g_realm = "Web Server Authentication";) \
        IF_FEATURE_HTTPD_RANGES(range_start = -1;) \
@@ -19,7 +19,7 @@ diff -u -r ../busybox-1.22.1/networking/httpd.c ./networking/httpd.c
        index_page = index_html; \
        file_size = -1; \
  } while (0)
-@@ -887,7 +887,7 @@
+@@ -1007,7 +1007,7 @@
        if (!errno && n && n <= 0xffff)
                n = create_and_bind_stream_or_die(NULL, n);
        else
@@ -28,12 +28,12 @@ diff -u -r ../busybox-1.22.1/networking/httpd.c ./networking/httpd.c
        xlisten(n, 9);
        return n;
  }
-@@ -2245,7 +2245,7 @@
-               proxy_fd = socket(AF_INET, SOCK_STREAM, 0);
-               if (proxy_fd < 0)
-                       send_headers_and_exit(HTTP_INTERNAL_SERVER_ERROR);
+@@ -2396,7 +2396,7 @@
+               int proxy_fd;
+               len_and_sockaddr *lsa;
 -              lsa = host2sockaddr(proxy_entry->host_port, 80);
 +              lsa = host2sockaddr(proxy_entry->host_port, 8080);
                if (lsa == NULL)
                        send_headers_and_exit(HTTP_INTERNAL_SERVER_ERROR);
-               if (connect(proxy_fd, &lsa->u.sa, lsa->len) < 0)
+               proxy_fd = socket(lsa->u.sa.sa_family, SOCK_STREAM, 0);