"server push" (unbuffered) cgi not working in apache2?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux