httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Smithfeld" <ab45...@gmail.com>
Subject [users@httpd] "server push" (unbuffered) cgi not working in apache2?
Date Sat, 01 Dec 2007 19:15:02 GMT
Hi. I am trying to write a (somewhat) long-running cgi script that
will display its
output as it processes.
Right now, my browser is waiting until receiving all the output (until
the script
terminates or closes stdout) before displaying anything.

Based on what I have read,  content should be pushed to the client
whenever my script flushes stdout. For example this is what is claimed
at  http://httpd.apache.org/docs/1.3/misc/FAQ-F.html#nph-scripts

I am using apache 2.2.4 on x64 Ubuntu.

Here is an example script in perl:
#!/usr/bin/perl
$| = 1;

print "Content-type: text/plain\n\n";

for ($i = 1; $i < 5; $i++)
{
        print "$i\n";
        sleep(3);
}

And in python:
#!/usr/bin/python
import time
import sys

print "Content-type: text/plain\n"

for i in xrange(4):
    print i
    sys.stdout.flush()
    time.sleep(3)


In both cases, the client waits for script to finish before displaying
anything. Why?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message