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>
This commit is contained in:
parent
208d35d21f
commit
8fc9e6a15d
@ -1786,13 +1786,13 @@
|
|||||||
"\n -i Inetd mode" \
|
"\n -i Inetd mode" \
|
||||||
"\n -f Don't daemonize" \
|
"\n -f Don't daemonize" \
|
||||||
"\n -v[v] Verbose" \
|
"\n -v[v] Verbose" \
|
||||||
"\n -c FILE Configuration file (default httpd.conf)" \
|
|
||||||
"\n -p [IP:]PORT Bind to ip:port (default *:80)" \
|
"\n -p [IP:]PORT Bind to ip:port (default *:80)" \
|
||||||
IF_FEATURE_HTTPD_SETUID( \
|
IF_FEATURE_HTTPD_SETUID( \
|
||||||
"\n -u USER[:GRP] Set uid/gid after binding to port") \
|
"\n -u USER[:GRP] Set uid/gid after binding to port") \
|
||||||
IF_FEATURE_HTTPD_BASIC_AUTH( \
|
IF_FEATURE_HTTPD_BASIC_AUTH( \
|
||||||
"\n -r REALM Authentication Realm for Basic Authentication") \
|
"\n -r REALM Authentication Realm for Basic Authentication") \
|
||||||
"\n -h HOME Home directory (default .)" \
|
"\n -h HOME Home directory (default .)" \
|
||||||
|
"\n -c FILE Configuration file (default {/etc,HOME}/httpd.conf)" \
|
||||||
IF_FEATURE_HTTPD_AUTH_MD5( \
|
IF_FEATURE_HTTPD_AUTH_MD5( \
|
||||||
"\n -m STRING MD5 crypt STRING") \
|
"\n -m STRING MD5 crypt STRING") \
|
||||||
"\n -e STRING HTML encode STRING" \
|
"\n -e STRING HTML encode STRING" \
|
||||||
|
@ -1145,13 +1145,14 @@ static NOINLINE void cgi_io_loop_and_exit(int fromCgi_rd, int toCgi_wr, int post
|
|||||||
/* post_len <= 0 && hdr_cnt <= 0:
|
/* post_len <= 0 && hdr_cnt <= 0:
|
||||||
* no more POST data to CGI,
|
* no more POST data to CGI,
|
||||||
* let CGI see EOF on CGI's stdin */
|
* let CGI see EOF on CGI's stdin */
|
||||||
close(toCgi_wr);
|
if (toCgi_wr != fromCgi_rd)
|
||||||
|
close(toCgi_wr);
|
||||||
toCgi_wr = 0;
|
toCgi_wr = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now wait on the set of sockets */
|
/* Now wait on the set of sockets */
|
||||||
count = safe_poll(pfd, 3, -1);
|
count = safe_poll(pfd, toCgi_wr ? TO_CGI+1 : FROM_CGI+1, -1);
|
||||||
if (count <= 0) {
|
if (count <= 0) {
|
||||||
#if 0
|
#if 0
|
||||||
if (safe_waitpid(pid, &status, WNOHANG) <= 0) {
|
if (safe_waitpid(pid, &status, WNOHANG) <= 0) {
|
||||||
@ -2103,8 +2104,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
|
|||||||
header_ptr += 2;
|
header_ptr += 2;
|
||||||
write(proxy_fd, header_buf, header_ptr - header_buf);
|
write(proxy_fd, header_buf, header_ptr - header_buf);
|
||||||
free(header_buf); /* on the order of 8k, free it */
|
free(header_buf); /* on the order of 8k, free it */
|
||||||
/* cgi_io_loop_and_exit needs to have two distinct fds */
|
cgi_io_loop_and_exit(proxy_fd, proxy_fd, length);
|
||||||
cgi_io_loop_and_exit(proxy_fd, dup(proxy_fd), length);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user