httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1755930 - in /httpd/httpd/trunk/modules: aaa/mod_authnz_fcgi.c proxy/mod_proxy_fcgi.c
Date Thu, 11 Aug 2016 10:32:35 GMT
Author: ylavic
Date: Thu Aug 11 10:32:35 2016
New Revision: 1755930

URL: http://svn.apache.org/viewvc?rev=1755930&view=rev
Log:
mod_{proxy,authnz}_fcgi: follow up to r1750392.
Don't try to read past AP_FCGI_END_REQUEST on the backend side, it would be
a response for the next request.


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=1755930&r1=1755929&r2=1755930&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:32:35 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, done = 0;
+    int seen_end_of_headers = 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 (!done && rv == APR_SUCCESS) { /* Keep reading FastCGI records until
-                                          * we get AP_FCGI_END_REQUEST (done)
-                                          * or an error occurs.
-                                          */
+    while (1) { /* Keep reading FastCGI records until
+                 * we get AP_FCGI_END_REQUEST,
+                 * 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:
-            done = 1;
+            /* we are done below */
             break;
 
         default:
@@ -641,8 +641,8 @@ static apr_status_t handle_response(cons
                           "%d", fn, type);
             break;
         }
-        /* Leave on above switch's inner error. */
-        if (rv != APR_SUCCESS) {
+        /* Leave on above switch's inner end/error. */
+        if (rv != APR_SUCCESS || type == AP_FCGI_END_REQUEST) {
             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=1755930&r1=1755929&r2=1755930&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:32:35 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, done = 0, ignore_body = 0;
+    int seen_end_of_headers = 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 (! done) {
+    while (1) {
         apr_interval_time_t timeout;
         apr_size_t len;
         int n;
@@ -772,7 +772,7 @@ recv_again:
                 break;
 
             case AP_FCGI_END_REQUEST:
-                done = 1;
+                /* we are done below */
                 break;
 
             default:
@@ -780,8 +780,8 @@ recv_again:
                               "Got bogus record %d", type);
                 break;
             }
-            /* Leave on above switch's inner error. */
-            if (rv != APR_SUCCESS) {
+            /* Leave on above switch's inner end/error. */
+            if (rv != APR_SUCCESS || type == AP_FCGI_END_REQUEST) {
                 break;
             }
 



Mime
View raw message