From 1c56d5b9d33600dd4de98c6098f37894b16f365d Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sun, 24 Feb 2002 04:47:22 +0000 Subject: [PATCH] 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 --- modules/filters/mod_include.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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, -- 2.50.1