httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r366412 - /httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c
Date Fri, 06 Jan 2006 03:51:48 GMT
Author: rooneg
Date: Thu Jan  5 19:51:43 2006
New Revision: 366412

URL: http://svn.apache.org/viewcvs?rev=366412&view=rev
Log:
Read the FCGI_STDERR stream and log it to the error log.  This will need
cleanup, but at least it keeps us from messing up the stream when we get
stuff written to stderr by the fastcgi process.

* modules/proxy/mod_proxy_fcgi.c
  (dispatch): Move the plen recv down after the switch, so it gets done
   for all cases that have padding.  Read data for the FCGI_STDERR case
   just like we do for FCGI_STDOUT, but write it to the log instead of
   sending it to the client.

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=366412&r1=366411&r2=366412&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 Thu Jan  5 19:51:43
2006
@@ -590,19 +590,19 @@
 
                     /* XXX Why don't we cleanup here?  (logic from AJP) */
                 }
-
-                if (plen) {
-                    readbuflen = plen;
-
-                    rv = apr_socket_recv(conn->sock, readbuf, &readbuflen);
-                    if (rv != APR_SUCCESS) {
-                        break;
-                    }
-                }
                 break;
 
             case FCGI_STDERR:
-                /* XXX TODO FCGI_STDERR gets written to the log file. */
+                /* TODO: Should probably clean up this logging a bit... */
+                if (clen) {
+                    ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
+                                 "proxy: FCGI: Got error '%s'", readbuf);
+                }
+
+                if (clen > readbuflen) {
+                    clen -= readbuflen;
+                    goto recv_again;
+                }
                 break;
 
             case FCGI_END_REQUEST:
@@ -613,6 +613,15 @@
                 ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                              "proxy: FCGI: Got bogus record %d", type);
                 break;
+            }
+
+            if (plen) {
+                readbuflen = plen;
+
+                rv = apr_socket_recv(conn->sock, readbuf, &readbuflen);
+                if (rv != APR_SUCCESS) {
+                    break;
+                }
             }
         }
     }



Mime
View raw message