httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keijser, Jan Just" <KEIJSE...@logica.com>
Subject unbuffered CGI's on Win32
Date Tue, 30 Nov 1999 20:12:37 GMT
Hi again,

I've been investigating the use of unbuffered CGI's on Win95/98 and I
*think* I have found the problem but I don't know the best solution.

A short description of the problem:
if a user has a CGI that returns output every 2 seconds, the output is sent
to the browser only after the entire CGI script has completed. On real
systems (e.g. UNIX) the output is sent while the CGI is executing.

The problem is _NOT_ related to buffered pipes to/from the CGI program. The
output from the CGI program is read in a timely fashion (i.e. unbuffered and
not only after the CGI has completed). The problem lies in sending the data
back to the browser. I have isolated the cause of this: file main/buff.c,
lines

	if (!(fb->flags & B_WR)) {
/* unbuffered write -- have to use bcwrite since we aren't taking care
 * of chunking any other way */
	return bcwrite(fb, buf, nbyte);
    }

This is never called, since I cannot find any line that does 
  fb->flags &= B_WR;
or something similar; as an experiment, I removed the 'if' statement and
just plain called bcwrite. Lo and behold, the CGI output was unbuffered! 

The question now is, can I just remove the 'if' statement? Why is it there
in the first place?

Regards,

JJ Keijser
Logica Inc

Mime
View raw message