From: Ruediger Pluem Date: Thu, 6 Nov 2008 12:23:17 +0000 (+0000) Subject: Merge r707649, r707665 from trunk: X-Git-Tag: 2.2.11~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08c6e193026cd821920645ed3364cbca5b698bfa;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/STATUS b/STATUS index 86712755062..060911ffcd5 100644 --- 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 ] diff --git a/modules/proxy/ajp_header.c b/modules/proxy/ajp_header.c index b506946c356..9130de9a78a 100644 --- a/modules/proxy/ajp_header.c +++ b/modules/proxy/ajp_header.c @@ -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;