perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mårten Svantesson <>
Subject [mp2] "did not send an HTTP header" due to (involuntary) flush
Date Tue, 03 Jun 2008 10:17:04 GMT
We are migrating a big site from mod_perl1 to mod_perl2. The site originally was written as
CGIs so headers are mostly set with print statements. The
Content-Type are mostly printed in the end of the script.

The problem is that we occassionally start processes from the scripts and then the output
gets flushed and thus we get Internal Server Error with the
message "did not send an HTTP header" in the error.log.

I tried to write an output filter that merge all buckets until \n\n is encountered, but I
don't seem to be able to insert the filter so that it
executes before the mod_perl header parsing.

Looking in the mailing list archive it seems like this problem was extensively discussed in
the thread "[mp2] CGI redirects incorrectly handled?" back
in March 2003. In the final mail of the thread <>
Stas mentions possible future changes to
alleviate the problem. Has anything of this been implemented?

Or does anybody have any other idea how to solve this (without rewriting our scripts, which
are *many*)?

We are now running mod_perl 2.0.2 (the version available in RedHat EL) in Apache 2.2.3.

Our configuration:

<FilesMatch "\.(cgi|pl|pl5)$">
     SetHandler perl-script
     PerlFixupHandler Apache2::SizeLimit
     PerlResponseHandler ModPerl::Registry
     PerlOptions +ParseHeaders

  Mårten Svantesson

View raw message