Internal server error with fcgi when stdin is not read untill EOF is reached.

pps <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hi, I use fastcgi (mod_fastcgi-SNAP-0404142202-AP2.dll) with apache 
2.0.55 and I see a strange error.
the result is internal server error.


I code my apps in c++ and when I wrote file post code I wrote it in such 
a way that if posted data size is bigger than the max allowed limit, 
then only up to max data is read from stdin and the rest is discarded.

in this case I see a strange behavior.

here's a test case in more detail:
I set max post size to 256KB.
If I try to upload more than that everything is ok, but if I try to do 
that again in the next request I get internal server error (sometimes I 
need to repeat reposting large files a couple of times, and then each 
request where stdin is not read until EOF generates this error). I also 
tried to use fcgid and with it I get the same error but on the first 
request.
The same binary run as cgi-bin behaves without any problem. (By the way, 
why not fastcgi lib automatically reopens stdin in binary mode?)

here's what I got in error.log:
(OS 233)No process is on the other end of the pipe.  : FastCGI: comm 
with server "..."aborted: WriteFile() failed
FastCGI: incomplete headers (0 bytes) received from server


if I simply add a line to skip data from stdin to the end then there's 
no this error anymore:

while (fgetc(stdin) != EOF) ;

Is it something wrong with mod_fastcgi or do I have to read stdin until 
EOF is reached or not to read from stdin at all?


thanks
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.