You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Rob Brown <ro...@0catch.com> on 2003/02/18 01:50:27 UTC

[users@httpd] Content-Length HTTP/1.0 BUG

I'm trying to use Apache 2.0.40 but I can't force my cgi to hot flush the 
output to the browser using HTTP/1.0. 


tick.cgi:
 --- snip ---
#!/usr/bin/perl 

print "Content-length: text/html\n\n";
$| = 1; # TRY REALLY REALLY REALLY HARD TO FLUSH
print "Timer running...<br>\n";
for (1..10) {
 print "Test $_<br>\n";
 sleep 1;
}
 --- snap --- 

$ telnet localhost 80
GET /cgi-bin/tick.cgi HTTP/1.0 


[.... chokes for 10 seconds before saying ANYTHING!] 

If I downgrade to Apache 1.3.27, everything works perfectly. 

Or if I switch HTTP/1.0 to HTTP/1.1 then everything work perfectly. 

Is there a -DDONT_CHOKE option or some configuration
directive that I can add to force my cgis to really
really really really flush the output to the browser
on the fly using HTTP/1.0 under Apache 2.x?  I could
care less if there's no "Content-Length" header or if
it's inaccurate.  It seems like someone went to a lot
of work to add a "Content-Length" header when I don't
need it nor want it.  How can I skip it?  I couldn't
find anything in the documentation. 

---------------------------------------------------------------------
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


Re: [users@httpd] Re: Content-Length HTTP/1.0 BUG

Posted by André Malo <nd...@perlig.de>.
* Rob Brown wrote:

> The nph-tick did make it non-parsed script,
> yet it still hung exactly like before.
> That totally did not work.

PLease try a more recent version of apache. It works very fine here:
(nph-tick.pl)

#!perl -w

print "HTTP/1.0 200 OK\n";
print "Content-type: text/html\n\n";
$| = 1; # TRY REALLY REALLY REALLY HARD TO FLUSH
print "Timer running...<br>\n";
for (1..10) {
 print "Test $_<br>\n";
 sleep 1;
}
__END__

nd
-- 
sub the($){+shift} sub answer (){ord q
        [* It is always 42! *]       }
           print the answer
# André Malo # http://www.perlig.de/ #

---------------------------------------------------------------------
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


[users@httpd] Re: Content-Length HTTP/1.0 BUG

Posted by Rob Brown <ro...@0catch.com>.
André Malo writes: 

> * Rob Brown wrote: 
> 
>> $| = 1; # TRY REALLY REALLY REALLY HARD TO FLUSH
>> $ telnet localhost 80
>> GET /cgi-bin/tick.cgi HTTP/1.0
> 
>> need it nor want it.  How can I skip it?  I couldn't
>> find anything in the documentation.
> 
> simply rename your script to nph-tick.cgi. nph-scripts skip all filters 
> beyond connection filters.

The nph-tick did make it non-parsed script,
yet it still hung exactly like before.
That totally did not work. 

 -- Rob 

---------------------------------------------------------------------
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


Re: [users@httpd] Content-Length HTTP/1.0 BUG

Posted by André Malo <nd...@perlig.de>.
* Rob Brown wrote:

> $| = 1; # TRY REALLY REALLY REALLY HARD TO FLUSH
> $ telnet localhost 80
> GET /cgi-bin/tick.cgi HTTP/1.0

> need it nor want it.  How can I skip it?  I couldn't
> find anything in the documentation.

simply rename your script to nph-tick.cgi. nph-scripts skip all filters 
beyond connection filters.

nd
-- 
sub the($){+shift} sub answer (){ord q
        [* It is always 42! *]       }
           print the answer
# André Malo # http://www.perlig.de/ #

---------------------------------------------------------------------
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


[users@httpd] Re: Content-Length HTTP/1.0 BUG

Posted by Rob Brown <ro...@0catch.com>.
Jacob Coby writes: 

>> print "Content-length: text/html\n\n";
>> $| = 1; # TRY REALLY REALLY REALLY HARD TO FLUSH
>> print "Timer running...<br>\n";
>> for (1..10) {
>>  print "Test $_<br>\n";
>>  sleep 1;
>> }
>>  --- snap --- 
> 
> I thought Content-length was supposed to be a number not a MIME type? 
> 

My bad.  I totally meant "Content-Type" instead of "Content-length" 

> Does perl have a flush() function?

It isn't perl.  It's within Apache itself. 

---------------------------------------------------------------------
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


Re: [users@httpd] Content-Length HTTP/1.0 BUG

Posted by Jacob Coby <jc...@listingbook.com>.
> print "Content-length: text/html\n\n";
> $| = 1; # TRY REALLY REALLY REALLY HARD TO FLUSH
> print "Timer running...<br>\n";
> for (1..10) {
>  print "Test $_<br>\n";
>  sleep 1;
> }
>  --- snap --- 

I thought Content-length was supposed to be a number not a MIME type?

Does perl have a flush() function?

-Jacob


---------------------------------------------------------------------
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


Re: [users@httpd] Content-Length HTTP/1.0 BUG

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 17 Feb 2003, Rob Brown wrote:

> I'm trying to use Apache 2.0.40 but I can't force my cgi to hot flush the
> output to the browser using HTTP/1.0.

Try the latest version (2.0.44).  At some point, the content-length filter
was made less agressive about queing up the contents.

Joshua.

---------------------------------------------------------------------
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