aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/httpd.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 52b2b2a7a..5cd98a573 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -32,7 +32,7 @@
32 * foo=`httpd -d $foo` # decode "Hello%20World" as "Hello World" 32 * foo=`httpd -d $foo` # decode "Hello%20World" as "Hello World"
33 * bar=`httpd -e "<Hello World>"` # encode as "&#60Hello&#32World&#62" 33 * bar=`httpd -e "<Hello World>"` # encode as "&#60Hello&#32World&#62"
34 * Note that url encoding for arguments is not the same as html encoding for 34 * Note that url encoding for arguments is not the same as html encoding for
35 * presentation. -d decodes a url-encoded argument while -e encodes in html 35 * presentation. -d decodes an url-encoded argument while -e encodes in html
36 * for page display. 36 * for page display.
37 * 37 *
38 * httpd.conf has the following format: 38 * httpd.conf has the following format:
@@ -94,6 +94,7 @@
94 * server exits with an error. 94 * server exits with an error.
95 * 95 *
96 */ 96 */
97 /* TODO: use TCP_CORK, parse_config() */
97 98
98#include "libbb.h" 99#include "libbb.h"
99#if ENABLE_FEATURE_HTTPD_USE_SENDFILE 100#if ENABLE_FEATURE_HTTPD_USE_SENDFILE
@@ -1538,11 +1539,6 @@ static NOINLINE void send_file_and_exit(const char *url, int what)
1538 send_headers_and_exit(HTTP_NOT_FOUND); 1539 send_headers_and_exit(HTTP_NOT_FOUND);
1539 log_and_exit(); 1540 log_and_exit();
1540 } 1541 }
1541
1542 if (DEBUG)
1543 bb_error_msg("sending file '%s' content-type: %s",
1544 url, found_mime_type);
1545
1546 /* If you want to know about EPIPE below 1542 /* If you want to know about EPIPE below
1547 * (happens if you abort downloads from local httpd): */ 1543 * (happens if you abort downloads from local httpd): */
1548 signal(SIGPIPE, SIG_IGN); 1544 signal(SIGPIPE, SIG_IGN);
@@ -1570,6 +1566,11 @@ static NOINLINE void send_file_and_exit(const char *url, int what)
1570 } 1566 }
1571 } 1567 }
1572 } 1568 }
1569
1570 if (DEBUG)
1571 bb_error_msg("sending file '%s' content-type: %s",
1572 url, found_mime_type);
1573
1573#if ENABLE_FEATURE_HTTPD_RANGES 1574#if ENABLE_FEATURE_HTTPD_RANGES
1574 if (what == SEND_BODY) 1575 if (what == SEND_BODY)
1575 range_start = 0; /* err pages and ranges don't mix */ 1576 range_start = 0; /* err pages and ranges don't mix */
@@ -2085,7 +2086,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
2085 header_ptr += 2; 2086 header_ptr += 2;
2086 write(proxy_fd, header_buf, header_ptr - header_buf); 2087 write(proxy_fd, header_buf, header_ptr - header_buf);
2087 free(header_buf); /* on the order of 8k, free it */ 2088 free(header_buf); /* on the order of 8k, free it */
2088 /* cgi_io_loop_and_exit needs to have two disctinct fds */ 2089 /* cgi_io_loop_and_exit needs to have two distinct fds */
2089 cgi_io_loop_and_exit(proxy_fd, dup(proxy_fd), length); 2090 cgi_io_loop_and_exit(proxy_fd, dup(proxy_fd), length);
2090 } 2091 }
2091#endif 2092#endif