matts 2003/09/18 15:12:33
Modified: lib AxKit.pm Log: Send Content-Length with gzipped output No need to do pack stuff any more - we have use bytes POWER! Revision Changes Path 1.53 +9 -10 xml-axkit/lib/AxKit.pm Index: AxKit.pm =================================================================== RCS file: /home/cvs/xml-axkit/lib/AxKit.pm,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- AxKit.pm 17 Sep 2003 19:27:59 -0000 1.52 +++ AxKit.pm 18 Sep 2003 22:12:33 -0000 1.53 @@ -965,16 +965,14 @@ my ($transformer, $doit) = get_output_transformer(); if ($AxKit::Cfg->DoGzip) { AxKit::Debug(4, 'Sending gzipped xml string to browser'); + my $data = Compress::Zlib::memGzip($doit ? + $transformer->($r->pnotes('xml_string')) : + $r->pnotes('xml_string') + ); + $r->header_out('Content-Length' => length($data)); AxKit::Apache::send_http_header($r); return DONE if $r->method eq 'HEAD'; - if ($doit) { - $r->print( unpack($]>5.00555?"U0A*":"A*", Compress::Zlib::memGzip( - $transformer->( $r->pnotes('xml_string') ) - ) ) ); - } - else { - $r->print( unpack($]>5.00555?"U0A*":"A*", Compress::Zlib::memGzip( $r->pnotes('xml_string') ) ) ); - } + $r->print($data); } else { AxKit::Apache::send_http_header($r); @@ -1114,7 +1112,8 @@ sub print { my $self = shift; - + use bytes; + if ($self->notes('resetstring')) { $self->pnotes('xml_string', ''); $self->notes('resetstring', 0);