From: Jim Jagielski Date: Tue, 17 Jun 2014 12:04:23 +0000 (+0000) Subject: Merge r1603027, r1603029, r1603122 from trunk: X-Git-Tag: 2.4.10~123 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc1f0f90956275e4cdba30e1c2617f56198f36d5;p=apache Merge r1603027, r1603029, r1603122 from trunk: Fix bug introduced in r1591508 which resulted in the final empty FCGI_STDIN not being sent. Interaction with latest uWSGI (and probably other protocol implementations) breaks without this. Reindent after small fix in r1603027 mod_proxy_fcgi: follow up to r1592032. Also break the outer loop when "sending stdin" fails. Submitted by: trawick, ylavic Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1603140 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index b40a4490b1..4406086b44 100644 --- a/STATUS +++ b/STATUS @@ -120,19 +120,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: 2.4.x patch: http://people.apache.org/~jailletc36/backport8.patch +1: jailletc36, ylavic, jim - * mod_proxy_fcgi: Repair sending empty stdin after r1601749 (i.e., regression - in 2.4.x branch after 2.4.9), repair lost error condition - trunk: http://svn.apache.org/r1603027 - http://svn.apache.org/r1603029 - http://svn.apache.org/r1603122 - 2.4.x: http://people.apache.org/~trawick/r1603027_plus_r1603029_plus_r1603122.txt - (the patch file resolves a small intersection with r1592032) - +1: trawick, ylavic, jim - ylavic: what's the point with r1592032 (does not seem to be related, at - least fixing the above)? - trawick: the patch resolves a conflict when merging these revisions - if r1592032 is not yet in the 2.4.x branch - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index 9513e99074..defbdaa0d7 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -485,20 +485,22 @@ static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf, to_send -= write_this_time; iobuf_cursor += write_this_time; } + if (rv != APR_SUCCESS) { + break; + } if (last_stdin) { pfd.reqevents = APR_POLLIN; /* Done with input data */ - if (writebuflen) { /* empty AP_FCGI_STDIN not already sent? */ - ap_fcgi_fill_in_header(&header, AP_FCGI_STDIN, request_id, - 0, 0); - ap_fcgi_header_to_array(&header, farray); + /* signal EOF (empty FCGI_STDIN) */ + ap_fcgi_fill_in_header(&header, AP_FCGI_STDIN, request_id, + 0, 0); + ap_fcgi_header_to_array(&header, farray); - vec[0].iov_base = (void *)farray; - vec[0].iov_len = sizeof(farray); + vec[0].iov_base = (void *)farray; + vec[0].iov_len = sizeof(farray); - rv = send_data(conn, vec, 1, &len, 1); - } + rv = send_data(conn, vec, 1, &len, 1); } }