httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r707649 - /httpd/httpd/trunk/modules/proxy/ajp_header.c
Date Fri, 24 Oct 2008 15:01:45 GMT
Author: jim
Date: Fri Oct 24 08:01:44 2008
New Revision: 707649

URL: http://svn.apache.org/viewvc?rev=707649&view=rev
Log:
AJP was dropping pre-existing cookies. Use same logic
as HTTP to tuck them away

Modified:
    httpd/httpd/trunk/modules/proxy/ajp_header.c

Modified: httpd/httpd/trunk/modules/proxy/ajp_header.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/ajp_header.c?rev=707649&r1=707648&r2=707649&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/ajp_header.c (original)
+++ httpd/httpd/trunk/modules/proxy/ajp_header.c Fri Oct 24 08:01:44 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,15 @@
 
     rc = ajp_msg_get_uint16(msg, &num_headers);
     if (rc == APR_SUCCESS) {
-        r->headers_out = apr_table_make(r->pool, num_headers);
+        /* 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;



Mime
View raw message