From: Jim Jagielski Date: Tue, 3 Jan 2006 14:40:26 +0000 (+0000) Subject: Align with FCGI protocol defines. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a77f586a9f76eaabde725eed38036c44fb545a88;p=apache Align with FCGI protocol defines. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/fcgi-proxy-dev@365643 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/fcgi_protocol.h b/modules/proxy/fcgi_protocol.h index e85c9ef180..5f16808ef5 100644 --- a/modules/proxy/fcgi_protocol.h +++ b/modules/proxy/fcgi_protocol.h @@ -52,6 +52,12 @@ typedef struct { unsigned char reserved; } fcgi_header; +/* + * Number of bytes in a fcgi_header. Future versions of the protocol + * will not reduce this number. + */ +#define FCGI_HEADER_LEN 8 + /* * Mask for flags component of FCGI_BeginRequestBody */ diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index fe4267d04f..f05a08485a 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -411,19 +411,18 @@ static apr_status_t dispatch(proxy_conn_rec *conn, request_rec *r, char plen = 0; apr_bucket *b; fcgi_header rheader; - int rheader_size = sizeof(fcgi_header); memset(readbuf, 0, sizeof(readbuf)); /* First, we grab the header... */ - readbuflen = rheader_size; + readbuflen = FCGI_HEADER_LEN; rv = apr_socket_recv(conn->sock, (char *)&rheader, &readbuflen); if (rv != APR_SUCCESS) { break; } - if (readbuflen != rheader_size) { + if (readbuflen != FCGI_HEADER_LEN) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "proxy: FCGI: Failed to read entire header"); rv = APR_EINVAL;