Commit 320a4122 authored by Ruediger Pluem's avatar Ruediger Pluem
Browse files

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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@711850 13f79535-47bb-0310-9956-ffa450edef68
parent 26d6a3fe
Loading
Loading
Loading
Loading
+0 −9
Changes for STATUS: 0 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -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 ]

+16 −1
Changes for modules/proxy/ajp_header.c: 16 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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;