]> granicus.if.org Git - apache/commitdiff
Revert r1755930: actually what'd be read after AP_FCGI_END_REQUEST is padding,
authorYann Ylavic <ylavic@apache.org>
Thu, 11 Aug 2016 10:40:49 +0000 (10:40 +0000)
committerYann Ylavic <ylavic@apache.org>
Thu, 11 Aug 2016 10:40:49 +0000 (10:40 +0000)
not any potential/errorneous next response.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755931 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_authnz_fcgi.c
modules/proxy/mod_proxy_fcgi.c

index e3da288d549921c81f30855f4807173ca8cffe44..a73bad61df80404bac04cfec8f37d323708634b0 100644 (file)
@@ -475,7 +475,7 @@ static apr_status_t handle_response(const fcgi_provider_conf *conf,
     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(const fcgi_provider_conf *conf,
 
     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(const fcgi_provider_conf *conf,
             break;
 
         case AP_FCGI_END_REQUEST:
-            /* we are done below */
+            done = 1;
             break;
 
         default:
@@ -641,8 +641,8 @@ static apr_status_t handle_response(const fcgi_provider_conf *conf,
                           "%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;
         }
 
index 3fc0044570da5bb5a2929ea595f445c4773c27c1..2a760fcb0255c74398215d97e2424ae3f9661ec6 100644 (file)
@@ -445,7 +445,7 @@ static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf,
                              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_rec *conn, proxy_dir_conf *conf,
     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;
             }