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 
<http://article.gmane.org/gmane.comp.apache.mod-perl/4889> 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
</FilesMatch>

-- 
  Mårten Svantesson

Reply via email to