You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2008/11/06 13:23:23 UTC

svn commit: r711850 - in /httpd/httpd/branches/2.2.x: STATUS modules/proxy/ajp_header.c

Author: rpluem
Date: Thu Nov  6 04:23:17 2008
New Revision: 711850

URL: http://svn.apache.org/viewvc?rev=711850&view=rev
Log:
Merge r707649, r707665 from trunk:

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

Modified:
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/proxy/ajp_header.c

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=711850&r1=711849&r2=711850&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Thu Nov  6 04:23:17 2008
@@ -95,15 +95,6 @@
         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 ]
 

Modified: httpd/httpd/branches/2.2.x/modules/proxy/ajp_header.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/ajp_header.c?rev=711850&r1=711849&r2=711850&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/ajp_header.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/ajp_header.c Thu Nov  6 04:23:17 2008
@@ -457,6 +457,11 @@
 
  */
 
+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 @@
 
     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;