You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2016/08/11 10:40:49 UTC

svn commit: r1755931 - in /httpd/httpd/trunk/modules: aaa/mod_authnz_fcgi.c proxy/mod_proxy_fcgi.c

Author: ylavic
Date: Thu Aug 11 10:40:49 2016
New Revision: 1755931

URL: http://svn.apache.org/viewvc?rev=1755931&view=rev
Log:
Revert r1755930: actually what'd be read after AP_FCGI_END_REQUEST is padding,
not any potential/errorneous next response.


Modified:
    httpd/httpd/trunk/modules/aaa/mod_authnz_fcgi.c
    httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c

Modified: httpd/httpd/trunk/modules/aaa/mod_authnz_fcgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_authnz_fcgi.c?rev=1755931&r1=1755930&r2=1755931&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authnz_fcgi.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_authnz_fcgi.c Thu Aug 11 10:40:49 2016
@@ -475,7 +475,7 @@ static apr_status_t handle_response(cons
     apr_status_t rv = APR_SUCCESS;
     const char *fn = "handle_response";
     int header_state = HDR_STATE_READING_HEADERS;
-    int seen_end_of_headers = 0;
+    int seen_end_of_headers = 0, done = 0;
 
     if (rspbuflen) {
         orspbuflen = *rspbuflen;
@@ -484,10 +484,10 @@ static apr_status_t handle_response(cons
 
     ob = apr_brigade_create(r->pool, r->connection->bucket_alloc);
 
-    while (1) { /* Keep reading FastCGI records until
-                 * we get AP_FCGI_END_REQUEST,
-                 * or an error occurs.
-                 */
+    while (!done && rv == APR_SUCCESS) { /* Keep reading FastCGI records until
+                                          * we get AP_FCGI_END_REQUEST (done)
+                                          * or an error occurs.
+                                          */
         apr_size_t readbuflen;
         apr_uint16_t clen;
         apr_uint16_t rid;
@@ -632,7 +632,7 @@ static apr_status_t handle_response(cons
             break;
 
         case AP_FCGI_END_REQUEST:
-            /* we are done below */
+            done = 1;
             break;
 
         default:
@@ -641,8 +641,8 @@ static apr_status_t handle_response(cons
                           "%d", fn, type);
             break;
         }
-        /* Leave on above switch's inner end/error. */
-        if (rv != APR_SUCCESS || type == AP_FCGI_END_REQUEST) {
+        /* Leave on above switch's inner error. */
+        if (rv != APR_SUCCESS) {
             break;
         }
 

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c?rev=1755931&r1=1755930&r2=1755931&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c Thu Aug 11 10:40:49 2016
@@ -445,7 +445,7 @@ static apr_status_t dispatch(proxy_conn_
                              int *bad_request, int *has_responded)
 {
     apr_bucket_brigade *ib, *ob;
-    int seen_end_of_headers = 0, ignore_body = 0;
+    int seen_end_of_headers = 0, done = 0, ignore_body = 0;
     apr_status_t rv = APR_SUCCESS;
     int script_error_status = HTTP_OK;
     conn_rec *c = r->connection;
@@ -472,7 +472,7 @@ static apr_status_t dispatch(proxy_conn_
     ib = apr_brigade_create(r->pool, c->bucket_alloc);
     ob = apr_brigade_create(r->pool, c->bucket_alloc);
 
-    while (1) {
+    while (! done) {
         apr_interval_time_t timeout;
         apr_size_t len;
         int n;
@@ -772,7 +772,7 @@ recv_again:
                 break;
 
             case AP_FCGI_END_REQUEST:
-                /* we are done below */
+                done = 1;
                 break;
 
             default:
@@ -780,8 +780,8 @@ recv_again:
                               "Got bogus record %d", type);
                 break;
             }
-            /* Leave on above switch's inner end/error. */
-            if (rv != APR_SUCCESS || type == AP_FCGI_END_REQUEST) {
+            /* Leave on above switch's inner error. */
+            if (rv != APR_SUCCESS) {
                 break;
             }