]> granicus.if.org Git - apache/commitdiff
* modules/proxy/proxy_http.c (ap_proxy_http_process_response): Handle
authorJoe Orton <jorton@apache.org>
Mon, 12 Jan 2004 14:08:08 +0000 (14:08 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 12 Jan 2004 14:08:08 +0000 (14:08 +0000)
all 1xx interim responses the same, one of the two 2616 compliance
issues in PR 19442.

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

modules/proxy/proxy_http.c

index 5b9154c37218e44bb45c197ca07d434bd5514da5..7dc8e8727537c553743c0e6cd87099350fc4f35a 100644 (file)
@@ -794,11 +794,8 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
     apr_bucket *e;
     apr_bucket_brigade *bb;
     int len, backasswards;
-    int received_continue = 1; /* flag to indicate if we should
-                                * loop over response parsing logic
-                                * in the case that the origin told us
-                                * to HTTP_CONTINUE
-                                */
+    int interim_response; /* non-zero whilst interim 1xx responses
+                           * are being read. */
 
     bb = apr_brigade_create(p, c->bucket_alloc);
 
@@ -812,7 +809,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
      */
     rp->proxyreq = PROXYREQ_RESPONSE;
 
-    while (received_continue) {
+    do {
         apr_brigade_cleanup(bb);
 
         len = ap_getline(buffer, sizeof(buffer), rp, 0);
@@ -935,11 +932,11 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
             p_conn->close += 1;
         }
 
-        if ( r->status != HTTP_CONTINUE ) {
-            received_continue = 0;
-        } else {
+        interim_response = ap_is_HTTP_INFO(r->status);
+        if (interim_response) {
             ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL,
-                         "proxy: HTTP: received 100 CONTINUE");
+                         "proxy: HTTP: received interim %d response",
+                         r->status);
         }
 
         /* we must accept 3 kinds of date, but generate only 1 kind of date */
@@ -999,7 +996,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
 
         /* send body - but only if a body is expected */
         if ((!r->header_only) &&                   /* not HEAD request */
-            (!ap_is_HTTP_INFO(r->status)) &&       /* not any 1xx response */
+            !interim_response &&                   /* not any 1xx response */
             (r->status != HTTP_NO_CONTENT) &&      /* not 204 */
             (r->status != HTTP_RESET_CONTENT) &&   /* not 205 */
             (r->status != HTTP_NOT_MODIFIED)) {    /* not 304 */
@@ -1078,7 +1075,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
             ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                          "proxy: header only");
         }
-    }
+    } while (interim_response);
 
     if ( conf->error_override ) {
         /* the code above this checks for 'OK' which is what the hook expects */
@@ -1092,8 +1089,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
             int status = r->status;
             r->status = HTTP_OK;
             /* Discard body, if one is expected */
-            if ((status > 199) && /* not any 1xx response */
-                (status != HTTP_NO_CONTENT) && /* not 204 */
+            if ((status != HTTP_NO_CONTENT) && /* not 204 */
                 (status != HTTP_RESET_CONTENT) && /* not 205 */
                 (status != HTTP_NOT_MODIFIED)) { /* not 304 */
                ap_discard_request_body(rp);