X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=networking%2Fhttpd.c;h=39aad90a8eca29cfe8de72300696fdaa303baadc;hb=7a18b9502aedbd6a9201c7c7603ded997a401f53;hp=d301d598dcfbe9ab878377c780191301373dcba1;hpb=47367e1d50b81501e8a6ce215f8be4eeacdda693;p=oweals%2Fbusybox.git diff --git a/networking/httpd.c b/networking/httpd.c index d301d598d..39aad90a8 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -102,7 +102,7 @@ //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" @@ -156,7 +156,7 @@ //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 @@ -185,7 +185,7 @@ //config: "<Hello World>". //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 @@ -198,7 +198,7 @@ //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 @@ -210,7 +210,7 @@ //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",