From: Jeff Trawick Date: Wed, 14 May 2014 10:45:20 +0000 (+0000) Subject: Merge r1591472 from trunk: X-Git-Tag: 2.4.10~240 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4823a6e7641f4d63ea43e318bd40bd0c2265188;p=apache Merge r1591472 from trunk: mod_proxy_fcgi: remove wasted memset() calls and other historical bits Submitted by: trawick Reviewed by: jim, ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1594537 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 4a6864d612..0753a8f2be 100644 --- a/STATUS +++ b/STATUS @@ -106,11 +106,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: 2.4.x patch: http://people.apache.org/~covener/patches/httpd-2.4.x-aliasmatch_contextinfo.diff +1 covener, jim, ylavic - * mod_proxy_fcgi: remove wasted memset() calls and other historical bits - trunk patch: http://svn.apache.org/r1591472 - 2.4.x patch: trunk patch works - +1: trawick, jim, ylavic - * mod_authn_socache: fix logging of bugus rv in r1576233 (now in 2.4.x) trunk patch: http://svn.apache.org/r1583007 2.4.x patch: trunk patch works diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index be4c3a21e4..f949875f5c 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -483,19 +483,13 @@ static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf, } if (pfd.rtnevents & APR_POLLIN) { - /* readbuf has one byte on the end that is always 0, so it's - * able to work with a strstr when we search for the end of - * the headers, even if we fill the entire length in the recv. */ - char readbuf[AP_IOBUFSIZE + 1]; + char readbuf[AP_IOBUFSIZE]; apr_size_t readbuflen; apr_uint16_t clen, rid; apr_bucket *b; unsigned char plen; unsigned char type, version; - memset(readbuf, 0, sizeof(readbuf)); - memset(farray, 0, sizeof(farray)); - /* First, we grab the header... */ rv = get_data_full(conn, (char *) farray, AP_FCGI_HEADER_LEN); if (rv != APR_SUCCESS) { @@ -528,8 +522,8 @@ static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf, } recv_again: - if (clen > sizeof(readbuf) - 1) { - readbuflen = sizeof(readbuf) - 1; + if (clen > sizeof(readbuf)) { + readbuflen = sizeof(readbuf); } else { readbuflen = clen; } @@ -542,7 +536,6 @@ recv_again: if (rv != APR_SUCCESS) { break; } - readbuf[readbuflen] = 0; } switch (type) {