}
}
if (!strcmp(tag, "errmsg")) {
- ap_ssi_parse_string(r, tag_val, ctx->error_str,
+ if (ctx->error_str_override == NULL) {
+ ctx->error_str_override = (char *)apr_palloc(ctx->pool,
+ MAX_STRING_LEN);
+ ctx->error_str = ctx->error_str_override;
+ }
+ ap_ssi_parse_string(r, tag_val, ctx->error_str_override,
MAX_STRING_LEN, 0);
- ctx->error_length = strlen(ctx->error_str);
}
else if (!strcmp(tag, "timefmt")) {
apr_time_t date = r->request_time;
-
- ap_ssi_parse_string(r, tag_val, ctx->time_str,
+ if (ctx->time_str_override == NULL) {
+ ctx->time_str_override = (char *)apr_palloc(ctx->pool,
+ MAX_STRING_LEN);
+ ctx->time_str = ctx->time_str_override;
+ }
+ ap_ssi_parse_string(r, tag_val, ctx->time_str_override,
MAX_STRING_LEN, 0);
apr_table_setn(env, "DATE_LOCAL", ap_ht_time(r->pool, date,
ctx->time_str, 0));
ctx->ssi_tag_brigade = apr_brigade_create(f->c->pool);
ctx->status = APR_SUCCESS;
- apr_cpystrn(ctx->error_str, conf->default_error_msg,
- sizeof(ctx->error_str));
- apr_cpystrn(ctx->time_str, conf->default_time_fmt,
- sizeof(ctx->time_str));
- ctx->error_length = strlen(ctx->error_str);
+ ctx->error_str = conf->default_error_msg;
+ ctx->time_str = conf->default_time_fmt;
+ ctx->pool = f->c->pool;
}
else {
return ap_pass_brigade(f->next, b);
#ifndef _MOD_INCLUDE_H
#define _MOD_INCLUDE_H 1
+#include "apr_pools.h"
+
#define STARTING_SEQUENCE "<!--#"
#define ENDING_SEQUENCE "-->"
apr_size_t directive_length;
apr_size_t tag_length;
- apr_size_t error_length;
- char error_str[MAX_STRING_LEN];
- char time_str[MAX_STRING_LEN];
+ char *error_str;
+ char *error_str_override;
+ char *time_str;
+ char *time_str_override;
+ apr_pool_t *pool;
apr_bucket_brigade *ssi_tag_brigade;
} include_ctx_t;
{ \
apr_size_t e_wrt; \
t_buck = apr_bucket_heap_create(cntx->error_str, \
- cntx->error_length, 1, &e_wrt); \
+ strlen(cntx->error_str), 1, &e_wrt); \
APR_BUCKET_INSERT_BEFORE(h_ptr, t_buck); \
\
if (ins_head == NULL) { \