httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r365813 - /httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c
Date Wed, 04 Jan 2006 03:51:59 GMT
Author: rooneg
Date: Tue Jan  3 19:51:58 2006
New Revision: 365813

URL: http://svn.apache.org/viewcvs?rev=365813&view=rev
Log:
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 *.

Modified:
    httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c

Modified: httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c?rev=365813&r1=365812&r2=365813&view=diff
==============================================================================
--- httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c (original)
+++ httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c Tue Jan  3 19:51:58
2006
@@ -406,10 +406,10 @@
              * 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 @@
             /* 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 @@
 
             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 @@
 #endif
             }
 
-            clen |= fheader[4] << 8;
-            clen |= fheader[5] << 0;
+            clen = (fheader[4] << 8) | fheader[5];
 
             plen = fheader[6];
 



Mime
View raw message