From: Ian Holsman Date: Sun, 24 Feb 2002 04:47:22 +0000 (+0000) Subject: notes need to be 'set' at the main requests pool X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4154aad8214b1fccac423cb103708c315d18b00f;p=apache notes need to be 'set' at the main requests pool not the 'sub-request' as notes live in the parent's request lifetime. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93556 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 31199e2f47..928fd64628 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -2743,6 +2743,16 @@ static int handle_set(include_ctx_t *ctx, apr_bucket_brigade **bb, char *var = NULL; apr_bucket *tmp_buck; char *parsed_string; + request_rec *sub = r->main; + apr_pool_t *p = r->pool; + + /* we need to use the 'main' request pool to set notes as that is + * a notes lifetime + */ + while (sub) { + p = sub->pool; + sub = sub->main; + } *inserted_head = NULL; if (ctx->flags & FLAG_PRINTING) { @@ -2768,8 +2778,8 @@ static int handle_set(include_ctx_t *ctx, apr_bucket_brigade **bb, } parsed_string = ap_ssi_parse_string(r, ctx, tag_val, NULL, MAX_STRING_LEN, 0); - apr_table_setn(r->subprocess_env, apr_pstrdup(r->pool, var), - apr_pstrdup(r->pool, parsed_string)); + apr_table_setn(r->subprocess_env, apr_pstrdup(p, var), + apr_pstrdup(p, parsed_string)); } else { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,