]> granicus.if.org Git - apache/commitdiff
Add option not to send&clear response headers in ap_send_interim_response.
authorNick Kew <niq@apache.org>
Fri, 26 Oct 2007 23:56:06 +0000 (23:56 +0000)
committerNick Kew <niq@apache.org>
Fri, 26 Oct 2007 23:56:06 +0000 (23:56 +0000)
We'll need this option to fix PR#43711, and ap_send_interim_response
is fortunately too new an API to have made it into anything stable.

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

include/http_protocol.h
modules/proxy/mod_proxy_http.c
server/protocol.c

index 4cf351e13d1c88abfc68c60e8919b47be8d28a3a..276d09bf98fb6b23acc809f3e0d699ed34a170e7 100644 (file)
@@ -668,8 +668,9 @@ AP_DECLARE(void) ap_finalize_sub_req_protocol(request_rec *sub_r);
 /**
  * Send an interim (HTTP 1xx) response immediately.
  * @param r The request
+ * @param send_headers Whether to send&clear headers in r->headers_out
  */
-AP_DECLARE(void) ap_send_interim_response(request_rec *r);
+AP_DECLARE(void) ap_send_interim_response(request_rec *r, int send_headers);
                                                                                 
 #ifdef __cplusplus
 }
index 762b2a8a1ef5377fb6fd3bdc69708366a8871b64..16a557a7e4313fa134dbb1625b71dcdba476fa31 100644 (file)
@@ -1532,7 +1532,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                          "proxy: HTTP: received interim %d response",
                          r->status);
             if (!policy || !strcasecmp(policy, "RFC")) {
-                ap_send_interim_response(r);
+                ap_send_interim_response(r, 1);
             }
             /* FIXME: refine this to be able to specify per-response-status
              * policies and maybe also add option to bail out with 502
index 6a878ca27da515027cd689ae8458835884490553..697f6997a808e634e6cfbe3554a4f84313b76930 100644 (file)
@@ -1641,7 +1641,7 @@ static int send_header(void *data, const char *key, const char *val)
                 key, ": ", val, CRLF, NULL);
     return 1;
 }
-AP_DECLARE(void) ap_send_interim_response(request_rec *r)
+AP_DECLARE(void) ap_send_interim_response(request_rec *r, int send_headers)
 {
     hdr_ptr x;
 
@@ -1658,11 +1658,13 @@ AP_DECLARE(void) ap_send_interim_response(request_rec *r)
     x.f = r->connection->output_filters;
     x.bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
     ap_fputstrs(x.f, x.bb, AP_SERVER_PROTOCOL, " ", r->status_line, CRLF, NULL);
-    apr_table_do(send_header, &x, r->headers_out, NULL);
+    if (send_headers) {
+        apr_table_do(send_header, &x, r->headers_out, NULL);
+        apr_table_clear(r->headers_out);
+    }
     ap_fputs(x.f, x.bb, CRLF);
     ap_fflush(x.f, x.bb);
     apr_brigade_destroy(x.bb);
-    apr_table_clear(r->headers_out);
 }