You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Igor Kovalenko <ko...@comm.mot.com> on 1999/08/05 07:21:04 UTC

Anyone experienced problem with piping CGI stdout back to server?

I'm trying to port Apache 1.3.6 to a new platform (Unix-like OS, called
Neutrino, from QNX Software).

Everything works, except for CGIs, which are broken in a weird way.
Their stdout simply is not being delivered back to server. I spent a
week tracing that, to noavail. The stdin and stderr both work fine. On
the CGI side everything seems to be ok, write() returns good numbers,
however read() on server side just always returns 0. No errors are
reported at OS level. 

I also tried to write a simple mod_cgi simulator which does all that
'pipe->fork->dup2->exec' sequence and then passes data all the way
around. Played with it to check OS capabilities - everything works as
expected.

Any hints?

Thanks,
- Igor

Re: Anyone experienced problem with piping CGI stdout back to server?

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.

On Thu, 5 Aug 1999, Igor Kovalenko wrote:

> I'm trying to port Apache 1.3.6 to a new platform (Unix-like OS, called
> Neutrino, from QNX Software).
> 
> Everything works, except for CGIs, which are broken in a weird way.
> Their stdout simply is not being delivered back to server. I spent a
> week tracing that, to noavail. The stdin and stderr both work fine. On
> the CGI side everything seems to be ok, write() returns good numbers,
> however read() on server side just always returns 0. No errors are
> reported at OS level. 
> 
> I also tried to write a simple mod_cgi simulator which does all that
> 'pipe->fork->dup2->exec' sequence and then passes data all the way
> around. Played with it to check OS capabilities - everything works as
> expected.

Asking the ovious, a flush does not give anything back, no errors ?

	if (fprintf(stdout, ...
		perror("fprintf..");
	if (fflush(stdout))
		perror("fflush..");

DW