flush to client before receive complete

[email protected]
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hello,

I'm using FCGI in an application where the client streams data over
chunked http to apache for several seconds.

I would like to sometimes send a response to the client before the client
is finished streaming data to apache.

The main loop in my barebones cgi program looks like this:

while (FCGI_Accept() >= 0)
{
  /* send result back to client right away */
  char sz[] = "Content-Type: text/html\r\n\r\nEarly Result\n";
  fwrite(sz, 1, strlen(sz), stdout);
  fflush(stdout);
}

When I stream data to this fcgi program I don't receive results until all
data is finished streaming to apache.  I'm expecting to get results right
away.  (I've tested my client to make sure it can receive results early.)

Does anyone know if this a basic limitation of apache or the http
protocol, or if there is a fcgi workaround, or apache config workaround?

Thanks for any help,
Jon
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.