From: Garrett Rooney Date: Wed, 4 Jan 2006 03:51:58 +0000 (+0000) Subject: Clean up record header parsing a bit. This may fix the problems some X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17fe7b54b5957b9b65b7ef2434169969798317c4;p=apache Clean up record header parsing a bit. This may fix the problems some people have seen where rid != request_id. * modules/proxy/mod_proxy_fcgi.c (dispatch): Stop initializing things we're just going to assign over them later, initialize all of the rid and clen variables, and fix a warning from passing an unsigned char array into apr_socket_recv by adding a cast to char *. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/fcgi-proxy-dev@365813 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index f18833061f..fc32f04927 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -406,10 +406,10 @@ static apr_status_t dispatch(proxy_conn_rec *conn, request_rec *r, * the headers, even if we fill the entire length in the recv. */ char readbuf[AP_IOBUFSIZE + 1]; apr_size_t readbuflen; - apr_size_t clen = 0; - int rid, type = 0; - char plen = 0; + apr_size_t clen; + int rid, type; apr_bucket *b; + char plen; /* * below mapped to fcgi_header layout. We * use a unsigned char array to ensure the @@ -424,7 +424,7 @@ static apr_status_t dispatch(proxy_conn_rec *conn, request_rec *r, /* First, we grab the header... */ readbuflen = FCGI_HEADER_LEN; - rv = apr_socket_recv(conn->sock, fheader, &readbuflen); + rv = apr_socket_recv(conn->sock, (char *) fheader, &readbuflen); if (rv != APR_SUCCESS) { break; } @@ -446,8 +446,7 @@ static apr_status_t dispatch(proxy_conn_rec *conn, request_rec *r, type = fheader[1]; - rid |= fheader[2] << 8; - rid |= fheader[3] << 0; + rid = (fheader[2] << 8) | fheader[3]; if (rid != request_id) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, @@ -459,8 +458,7 @@ static apr_status_t dispatch(proxy_conn_rec *conn, request_rec *r, #endif } - clen |= fheader[4] << 8; - clen |= fheader[5] << 0; + clen = (fheader[4] << 8) | fheader[5]; plen = fheader[6];