Subject: | AxAddOutputTransformer w/ cached content bug |
Hi,
apache conf file extract:
<AxMediaType screen>
<AxStyleName index>
AxAddProcessor text/xsl /test/test.xsl
AxAddOutputTransformer MyFilter::handler
</AxStyleName>
</AxMediaType>
with AxCacheDir unset this runs ok but when I set AxCacheDir a zero
length reply is returned from the server.
The exit point from Cache.pm is line 247:
if ($doit) {
AxKit::Debug(4, "Cache: Transforming content and printing to browser");
$r->pnotes('xml_string',$self->read());
return OK; # upstream deliver_to_browser should handle the rest
}
but in Axkit.pm this is not handled
I found that the the changes in the patch below seem to fix this
problem, but potentially break other AxKit code ;)
Regards,
George.
--- AxKit.pm 2006-02-13 15:09:58.521827112 +0000
+++ AxKit.pm 2006-02-13 15:31:57.391328472 +0000
@@ -981,6 +981,7 @@
}
if ($AxKit::Cache->no_cache() ||
+ $AxKit::Cache->exists ||
lc($r->dir_config('Filter')) eq 'on' ||
$r->method() eq 'POST')
{
@@ -1017,6 +1018,16 @@
$AxKit::Cache->write($r->pnotes('xml_string'));
$AxKit::Cache->deliver();
};
+ AxKit::Apache::send_http_header($r);
+ my ($transformer, $doit) = get_output_transformer();
+ if ($doit) {
+ $r->print(
+ $transformer->( $r->pnotes('xml_string') )
+ );
+ }
+ else {
+ $r->print( $r->pnotes('xml_string') );
+ }
if (my $E = $@) {
if ($E->isa('Apache::AxKit::Exception::IO')) {
AxKit::Debug(1, "WARNING: Unable to write to AxCacheDir
or .xmlstyle_cache");