From: Garrett Rooney Date: Fri, 6 Jan 2006 03:51:43 +0000 (+0000) Subject: Read the FCGI_STDERR stream and log it to the error log. This will need X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c759fb7127f0834e4683b768033e84eaf5aa6a64;p=thirdparty%2Fapache%2Fhttpd.git Read the FCGI_STDERR stream and log it to the error log. This will need cleanup, but at least it keeps us from messing up the stream when we get stuff written to stderr by the fastcgi process. * modules/proxy/mod_proxy_fcgi.c (dispatch): Move the plen recv down after the switch, so it gets done for all cases that have padding. Read data for the FCGI_STDERR case just like we do for FCGI_STDOUT, but write it to the log instead of sending it to the client. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/fcgi-proxy-dev@366412 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index 4df01333b03..ba82f121fb0 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -590,19 +590,19 @@ recv_again: /* XXX Why don't we cleanup here? (logic from AJP) */ } - - if (plen) { - readbuflen = plen; - - rv = apr_socket_recv(conn->sock, readbuf, &readbuflen); - if (rv != APR_SUCCESS) { - break; - } - } break; case FCGI_STDERR: - /* XXX TODO FCGI_STDERR gets written to the log file. */ + /* TODO: Should probably clean up this logging a bit... */ + if (clen) { + ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, + "proxy: FCGI: Got error '%s'", readbuf); + } + + if (clen > readbuflen) { + clen -= readbuflen; + goto recv_again; + } break; case FCGI_END_REQUEST: @@ -614,6 +614,15 @@ recv_again: "proxy: FCGI: Got bogus record %d", type); break; } + + if (plen) { + readbuflen = plen; + + rv = apr_socket_recv(conn->sock, readbuf, &readbuflen); + if (rv != APR_SUCCESS) { + break; + } + } } }