Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

pudge (1)

pudge
  (email not shown publicly)
http://pudge.net/
AOL IM: Crimethnk (Add Buddy, Send Message)

I run this joint, see?

Journal of pudge (1)

Friday November 14, 2003
02:22 PM

mod_gzip Calling Perl Handlers Twice

[ #15777 ]

With mod_gzip installed, my PerlAccessHandler handlers get called twice. I dislike this. Does anyone know what the heck is going on and how to fix it?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Replace mod_gzip by a perl-based solution ? there are several ones on CPAN.
    • Any recommendations? Apache::Dynagzip looks promising, as do Apache::Compress and Apache::GzipChain. I like Apache::Compress as I know Ken, and it looks simple, and handles files as well as dynamic content from mod_perl (does GzipChain do that? not sure). Dynagzip appears to send data in chunks, which is a nice thing, but I don't know the author and it looks more complicated to set up.
      • GzipChain is designed to be stackable, if your mod_perl supports it. In fact the bug you reported sounds like mod_gzip not correctly passing to the next handler, hence my proposal to use an alternative.
  • I would hazard a guess that your PerlAccessHandler is being called as part of a subrequest the second time. Try adding something like return unless $r->is_main to the top of your handler and see if it makes a difference.

    I've just been bitten by something similiar, but the other way around. mod_ssl doesn't set up environment variables until the fixup phase. Unfortunately, I needed them in the PerlAuthenHandler phase. So I had to run a subrequest and look at the environment variables for that instead

    • I would hazard a guess that your PerlAccessHandler is being called as part of a subrequest the second time. Try adding something like return unless $r->is_main to the top of your handler and see if it makes a difference.

      Yeah, we already have that in there. At one point some time ago we didn't, but it's been in there for some time now.