You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ICS.UCI.EDU> on 1997/05/08 06:31:14 UTC

Re: mod_cgi.c for M_GET...

>Is there any reason for cgi_handler() to still go through the 
>child_block semantics if (r->method_number == M_GET)?  

The method is independent of whether or not the message contains a body.
That is how HTTP is defined in order to allow for extensibility of the
method field even when the recipient does not know the semantics of
the method.

>I am running into some problems with a handler for 
>(r->method_number == M_POST) that calls a cgi through sub_req.  
>I get hung in the get_client_block() in mod_cgi.c/cgi_handler() and
>eventually timeout.  I think I am doing something stupid like
>not closing the POST input in my handler, but I still wonder
>why mod_cgi.c/cgi_handler() is trying to passthrough POST data
>even if it is a GET-ed cgi...

I am getting annoyed by this problem popping up all the time.  The
answer is that you CANNOT do an internal subrequest without creating
a new request structure which is not contaminated by the original request.

We could avoid the specific hang problem by adding a request variable 
toggle for has-the-message-been-read, and then setting that variable to 1 
the first time get_client_block is called.  However, that doesn't change
the fact that an internal redirect requires that the request structure
be properly re-initialized.

.....Roy