From 3fc456be47be980aeb4ec27227adfd4c4d653d1f Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 5 May 2015 15:32:13 +0000 Subject: [PATCH] improve caching of TT processors - remove a missing variable from cache key that was preventing compilation - explicitly pass the Apache2::RequestRec object to $tt->process(); this ensures that output is going back on the correct socket and avoids segfaulting Apache workers. Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index 5ead7c5c5c..db0645ddbc 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -64,7 +64,7 @@ sub handler_guts { my $processor_key = $as_xml ? 'xml:' : 'text:'; # separate by XML strictness $processor_key .= $ctx->{hostname}.':'; # ... and vhost $processor_key .= $r->dir_config('OILSWebContextLoader').':'; # ... and context loader - $processor_key .= $uri_section.':'.$ctx->{locale}; # ... and locale + $processor_key .= $ctx->{locale}; # ... and locale # NOTE: context loader and vhost together imply template path and debug template values # TODO: maybe add STAT_TTL and cache dir from LP#1449709? @@ -96,7 +96,7 @@ sub handler_guts { $vhost_processor_cache{$processor_key} = $tt; $ctx->{encode_utf8} = sub {return encode_utf8(shift())}; - unless($tt->process($template, {ctx => $ctx, ENV => \%ENV, l => $text_handler})) { + unless($tt->process($template, {ctx => $ctx, ENV => \%ENV, l => $text_handler}, $r)) { $r->log->warn('egweb: template error: ' . $tt->error); return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR; } -- 2.11.0