]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r707649, r707665 from trunk:
authorRuediger Pluem <rpluem@apache.org>
Thu, 6 Nov 2008 12:23:17 +0000 (12:23 +0000)
committerRuediger Pluem <rpluem@apache.org>
Thu, 6 Nov 2008 12:23:17 +0000 (12:23 +0000)
AJP was dropping pre-existing cookies. Use same logic
as HTTP to tuck them away

* save_table needs to be declared first before it can be used.

Reviewed by: rpluem, jim, mturk

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@711850 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/proxy/ajp_header.c

diff --git a/STATUS b/STATUS
index 867127550626e354fc55448942d8f1d011238b0b..060911ffcd527e1ff81891e9e352d972b59c5800 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -95,15 +95,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
         http://people.apache.org/~tdonovan/diffs/windows_odbc_22x_dsw.patch
      +1: tdonovan, wrowe, mturk
 
-   * mod_proxy_ajp: Don't discard previously set cookies from the output
-     headers.
-      Trunk version of patch:
-         http://svn.apache.org/viewvc?rev=707649&view=rev
-         http://svn.apache.org/viewvc?rev=707665&view=rev
-      Backport version for 2.2.x of patch:
-         Trunk version of patch works
-      +1: rpluem, jim, mturk
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
index b506946c35673011474f3422af827de309ddb716..9130de9a78a152a90375797f6048d42aed63c72f 100644 (file)
@@ -457,6 +457,11 @@ body_chunk :=
 
  */
 
+static int addit_dammit(void *v, const char *key, const char *val)
+{
+    apr_table_addn(v, key, val);
+    return 1;
+}
 
 static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
                                            request_rec *r,
@@ -493,7 +498,17 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
 
     rc = ajp_msg_get_uint16(msg, &num_headers);
     if (rc == APR_SUCCESS) {
-        r->headers_out = apr_table_make(r->pool, num_headers);
+        apr_table_t *save_table;
+
+        /* First, tuck away all already existing cookies */
+        /*
+         * Could optimize here, but just in case we want to
+         * also save other headers, keep this logic.
+         */
+        save_table = apr_table_make(r->pool, num_headers + 2);
+        apr_table_do(addit_dammit, save_table, r->headers_out,
+                     "Set-Cookie", NULL);
+        r->headers_out = save_table;
     } else {
         r->headers_out = NULL;
         num_headers = 0;