You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Geoffrey Young <gy...@laserlink.net> on 2001/01/03 19:37:15 UTC

RE: apache attempting to re-read POST from STDIN on ErrorDoc redi rect

> -----Original Message-----
> From: Eric Kolve [mailto:EKolve@classmates.com]
> Sent: Wednesday, January 03, 2001 1:25 PM
> To: 'modperl@apache.org'
> Subject: apache attempting to re-read POST from STDIN on ErrorDoc
> redirect
> 
> 
> I have the following Apache::Registry script, which posts to 
> itself.  At the
> top, I read in the posted values using CGI.  If I receive one 
> of them I die
> to demonstrate my little bug.  This causes a SERVER_ERROR to 
> be returned to
> apache, which then attempts to perform an internal redirect 
> to a static html
> errordoc page.  The problem I am having is that CGI has read 
> the posted
> values from STDIN, apache is trying to re-read them on the internal
> redirect, which causes it to block.  I have found several 
> solutions to this,
> one being to set CONTENT_LENTGTH to 0, or to simply use 
> Apache::Request
> instead of CGI.  What I am really interested in is what exactly is
> Apache::Request doing to prevent apache from attempting to 
> re-read from
> STDIN for post values.

not sure about the Apache::Request part, but a recent version of mod_perl
should fix this for you...

from Changes for 1.24_01:

fix $r->read() so it will not block if all data has already been read
and so that Apache will not hang during ap_discard_request_body() on
error or redirect after all data has been read

HTH

--Geoff

> 
> thanks,
> --eric
> 
> --SCRIPT--
> use strict;
> use CGI;
>  
> my $cgi = CGI->new;
>  
> my $mode = $cgi->param('mode');
> die if $mode;;
> print qq|Content-Type: text/html\n\n|;
>  
> print qq|
> <HTML>
> <FORM METHOD="POST" ACTION="test.pl">
> <INPUT TYPE="hidden" name="mode" value="1">
> <INPUT TYPE="submit">
> </FORM>
> </HTML>
> |; 
>