diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-02 10:40:58 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-02 10:40:58 +0200 |
commit | 8fc9e6a15d23c7e20ef135d8f242406b0aa0e8af (patch) | |
tree | ea50038b66ef8aa1626c36abbcf2500869721e4c | |
parent | 208d35d21fbae0f1c1aa3bed4ca97717565b76e2 (diff) | |
download | busybox-w32-8fc9e6a15d23c7e20ef135d8f242406b0aa0e8af.tar.gz busybox-w32-8fc9e6a15d23c7e20ef135d8f242406b0aa0e8af.tar.bz2 busybox-w32-8fc9e6a15d23c7e20ef135d8f242406b0aa0e8af.zip |
httpd: fix proxy mode bug (annoying but harmless), better help text
function old new delta
cgi_io_loop_and_exit 594 635 +41
packed_usage 26815 26841 +26
handle_incoming_and_exit 2745 2739 -6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | include/usage.h | 2 | ||||
-rw-r--r-- | networking/httpd.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/include/usage.h b/include/usage.h index cf576c666..f4ab39b08 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -1786,13 +1786,13 @@ | |||
1786 | "\n -i Inetd mode" \ | 1786 | "\n -i Inetd mode" \ |
1787 | "\n -f Don't daemonize" \ | 1787 | "\n -f Don't daemonize" \ |
1788 | "\n -v[v] Verbose" \ | 1788 | "\n -v[v] Verbose" \ |
1789 | "\n -c FILE Configuration file (default httpd.conf)" \ | ||
1790 | "\n -p [IP:]PORT Bind to ip:port (default *:80)" \ | 1789 | "\n -p [IP:]PORT Bind to ip:port (default *:80)" \ |
1791 | IF_FEATURE_HTTPD_SETUID( \ | 1790 | IF_FEATURE_HTTPD_SETUID( \ |
1792 | "\n -u USER[:GRP] Set uid/gid after binding to port") \ | 1791 | "\n -u USER[:GRP] Set uid/gid after binding to port") \ |
1793 | IF_FEATURE_HTTPD_BASIC_AUTH( \ | 1792 | IF_FEATURE_HTTPD_BASIC_AUTH( \ |
1794 | "\n -r REALM Authentication Realm for Basic Authentication") \ | 1793 | "\n -r REALM Authentication Realm for Basic Authentication") \ |
1795 | "\n -h HOME Home directory (default .)" \ | 1794 | "\n -h HOME Home directory (default .)" \ |
1795 | "\n -c FILE Configuration file (default {/etc,HOME}/httpd.conf)" \ | ||
1796 | IF_FEATURE_HTTPD_AUTH_MD5( \ | 1796 | IF_FEATURE_HTTPD_AUTH_MD5( \ |
1797 | "\n -m STRING MD5 crypt STRING") \ | 1797 | "\n -m STRING MD5 crypt STRING") \ |
1798 | "\n -e STRING HTML encode STRING" \ | 1798 | "\n -e STRING HTML encode STRING" \ |
diff --git a/networking/httpd.c b/networking/httpd.c index 8834c1c71..6dbc219e7 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -1145,13 +1145,14 @@ static NOINLINE void cgi_io_loop_and_exit(int fromCgi_rd, int toCgi_wr, int post | |||
1145 | /* post_len <= 0 && hdr_cnt <= 0: | 1145 | /* post_len <= 0 && hdr_cnt <= 0: |
1146 | * no more POST data to CGI, | 1146 | * no more POST data to CGI, |
1147 | * let CGI see EOF on CGI's stdin */ | 1147 | * let CGI see EOF on CGI's stdin */ |
1148 | close(toCgi_wr); | 1148 | if (toCgi_wr != fromCgi_rd) |
1149 | close(toCgi_wr); | ||
1149 | toCgi_wr = 0; | 1150 | toCgi_wr = 0; |
1150 | } | 1151 | } |
1151 | } | 1152 | } |
1152 | 1153 | ||
1153 | /* Now wait on the set of sockets */ | 1154 | /* Now wait on the set of sockets */ |
1154 | count = safe_poll(pfd, 3, -1); | 1155 | count = safe_poll(pfd, toCgi_wr ? TO_CGI+1 : FROM_CGI+1, -1); |
1155 | if (count <= 0) { | 1156 | if (count <= 0) { |
1156 | #if 0 | 1157 | #if 0 |
1157 | if (safe_waitpid(pid, &status, WNOHANG) <= 0) { | 1158 | if (safe_waitpid(pid, &status, WNOHANG) <= 0) { |
@@ -2103,8 +2104,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr) | |||
2103 | header_ptr += 2; | 2104 | header_ptr += 2; |
2104 | write(proxy_fd, header_buf, header_ptr - header_buf); | 2105 | write(proxy_fd, header_buf, header_ptr - header_buf); |
2105 | free(header_buf); /* on the order of 8k, free it */ | 2106 | free(header_buf); /* on the order of 8k, free it */ |
2106 | /* cgi_io_loop_and_exit needs to have two distinct fds */ | 2107 | cgi_io_loop_and_exit(proxy_fd, proxy_fd, length); |
2107 | cgi_io_loop_and_exit(proxy_fd, dup(proxy_fd), length); | ||
2108 | } | 2108 | } |
2109 | #endif | 2109 | #endif |
2110 | 2110 | ||