You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ni...@apache.org on 2007/10/27 01:56:07 UTC

svn commit: r588806 - in /httpd/httpd/trunk: include/http_protocol.h modules/proxy/mod_proxy_http.c server/protocol.c

Author: niq
Date: Fri Oct 26 16:56:06 2007
New Revision: 588806

URL: http://svn.apache.org/viewvc?rev=588806&view=rev
Log:
Add option not to send&clear response headers in ap_send_interim_response.
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.

Modified:
    httpd/httpd/trunk/include/http_protocol.h
    httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
    httpd/httpd/trunk/server/protocol.c

Modified: httpd/httpd/trunk/include/http_protocol.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/http_protocol.h?rev=588806&r1=588805&r2=588806&view=diff
==============================================================================
--- httpd/httpd/trunk/include/http_protocol.h (original)
+++ httpd/httpd/trunk/include/http_protocol.h Fri Oct 26 16:56:06 2007
@@ -668,8 +668,9 @@
 /**
  * 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
 }

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_http.c?rev=588806&r1=588805&r2=588806&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_http.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_http.c Fri Oct 26 16:56:06 2007
@@ -1532,7 +1532,7 @@
                          "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

Modified: httpd/httpd/trunk/server/protocol.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/protocol.c?rev=588806&r1=588805&r2=588806&view=diff
==============================================================================
--- httpd/httpd/trunk/server/protocol.c (original)
+++ httpd/httpd/trunk/server/protocol.c Fri Oct 26 16:56:06 2007
@@ -1641,7 +1641,7 @@
                 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 @@
     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);
 }