httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Holsman <li...@holsman.net>
Subject fcgi
Date Wed, 04 Jan 2006 09:32:44 GMT
I'm not sure why we aren't just reading the plen at the same time as the 
clen... but as is when the 2nd header is read, it is not in sync (out by 
padding-len bytes)

this patch makes it read at the same time, and it seems to make the 
handler work for larger responses (as the following header is now synced 
up properly)

--i


Index: mod_proxy_fcgi.c
===================================================================
--- mod_proxy_fcgi.c    (revision 365863)
+++ mod_proxy_fcgi.c    (working copy)
@@ -517,15 +517,15 @@
              plen = fheader[6];

              ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
-                "type %d request-id %d clen: %" APR_SIZE_T_FMT " plen %d",
+                "type %d request-id %d content len: %" APR_SIZE_T_FMT " 
padding length %d",
                  type, rid,
                  clen, plen
                  );
  recv_again:
-            if (clen > sizeof(readbuf) - 1) {
+            if (clen +plen> sizeof(readbuf) - 1) {
                  readbuflen = sizeof(readbuf) - 1;
              } else {
-                readbuflen = clen;
+                readbuflen = clen+plen;
              }

              /* Now get the actual data.  Yes it sucks to do this in a 
second
@@ -582,11 +582,11 @@

                      /* If we didn't read all the data go back and get the
                       * rest of it. */
-                    if (clen > readbuflen) {
+                    if (clen +plen > readbuflen) {
                          clen -= readbuflen;
                          goto recv_again;
                      }
-
+/*
                      if (plen) {
                          readbuflen = plen;

@@ -595,6 +595,7 @@
                              break;
                          }
                      }
+*/
                  } else {
                      b = apr_bucket_eos_create(c->bucket_alloc);

@@ -611,6 +612,9 @@

              case FCGI_STDERR:
                  /* XXX TODO FCGI_STDERR gets written to the log file. */
+                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "%*s",
+                        readbuflen,
+                        readbuf );
                  break;

              case FCGI_END_REQUEST:

Mime
View raw message