tls: reorder tls_handshake_data fields for smaller size, tweak comments
[oweals/busybox.git] / networking / httpd.c
index d301d598dcfbe9ab878377c780191301373dcba1..39aad90a8eca29cfe8de72300696fdaa303baadc 100644 (file)
 //config:      bool "httpd"
 //config:      default y
 //config:      help
-//config:        Serve web pages via an HTTP server.
+//config:        HTTP server.
 //config:
 //config:config FEATURE_HTTPD_RANGES
 //config:      bool "Support 'Ranges:' header"
 //config:        when specific URLs are requested.
 //config:
 //config:config FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR
-//config:      bool "Support for running scripts through an interpreter"
+//config:      bool "Support running scripts through an interpreter"
 //config:      default y
 //config:      depends on FEATURE_HTTPD_CGI
 //config:      help
 //config:        "&#60Hello&#32World&#62".
 //config:
 //config:config FEATURE_HTTPD_ERROR_PAGES
-//config:      bool "Support for custom error pages"
+//config:      bool "Support custom error pages"
 //config:      default y
 //config:      depends on HTTPD
 //config:      help
 //config:        message.
 //config:
 //config:config FEATURE_HTTPD_PROXY
-//config:      bool "Support for reverse proxy"
+//config:      bool "Support reverse proxy"
 //config:      default y
 //config:      depends on HTTPD
 //config:      help
 //config:        http://hostname[:port]/new/path/myfile.
 //config:
 //config:config FEATURE_HTTPD_GZIP
-//config:      bool "Support for GZIP content encoding"
+//config:      bool "Support GZIP content encoding"
 //config:      default y
 //config:      depends on HTTPD
 //config:      help
@@ -2396,12 +2396,12 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
                int proxy_fd;
                len_and_sockaddr *lsa;
 
-               proxy_fd = socket(AF_INET, SOCK_STREAM, 0);
-               if (proxy_fd < 0)
-                       send_headers_and_exit(HTTP_INTERNAL_SERVER_ERROR);
                lsa = host2sockaddr(proxy_entry->host_port, 80);
                if (lsa == NULL)
                        send_headers_and_exit(HTTP_INTERNAL_SERVER_ERROR);
+               proxy_fd = socket(lsa->u.sa.sa_family, SOCK_STREAM, 0);
+               if (proxy_fd < 0)
+                       send_headers_and_exit(HTTP_INTERNAL_SERVER_ERROR);
                if (connect(proxy_fd, &lsa->u.sa, lsa->len) < 0)
                        send_headers_and_exit(HTTP_INTERNAL_SERVER_ERROR);
                fdprintf(proxy_fd, "%s %s%s%s%s HTTP/%c.%c\r\n",