diff options
author | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2009-08-16 15:42:29 +0200 |
---|---|---|
committer | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2009-08-16 15:42:29 +0200 |
commit | 12b22ab633c19798d444e08b8be2b44d51d6acfd (patch) | |
tree | 5591b47094331740a093bc2342af728b4b788fba /lib | |
parent | 4df686a0aa8ef2f75be6cee2bfa2874f1bbb4437 (diff) |
Offload gzip compression when running under mod_perl.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/LXRng/Web.pm | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/LXRng/Web.pm b/lib/LXRng/Web.pm index 5b11a2d..a592b9a 100644 --- a/lib/LXRng/Web.pm +++ b/lib/LXRng/Web.pm @@ -48,6 +48,8 @@ eval { require PerlIO::gzip; $has_gzip_io = 1; }; sub do_compress_response { my ($query) = @_; + # Use mod_deflate when running under mod_perl. + return 0 if $INC{'LXRng/ModPerl.pm'}; my @enc = split(",", $query->http('Accept-Encoding')); return $has_gzip_io && grep { $_ eq 'gzip' } @enc; } @@ -371,12 +373,6 @@ sub source { return $id; } - - # TODO: This is potentially useful, in that it resets the stream - # to uncompressed mode. However, under Perl 5.8.8+PerlIO::gzip - # 0.18, this seems to truncate the stream. Not strictly needed - # for CGI, reexamine when adapting to mod_perl. - ## binmode(\*STDOUT, ":pop") if $gzip; } @@ -563,8 +559,6 @@ sub handle_ajax_request { elsif ($context->param('fname') eq 'pjx_releases') { print_release_list($context, $template); } - - # binmode(\*STDOUT, ":pop") if $gzip; } |