mirror of
https://github.com/lammertb/libhttp.git
synced 2025-08-09 03:22:45 +03:00
timeout.cgi test sometimes failed.
Using STDOUT->autoflush(1) seems to work better than $|=1 - I don't know why. Also made the timeout.cgi test a bit more verbose.
This commit is contained in:
parent
a57f2cf744
commit
08bf149d85
@@ -183,8 +183,11 @@ o("GET /%68%65%6c%6c%6f%2e%74%78%74 HTTP/1.0\n\n",
|
|||||||
# Break CGI reading after 1 second. We must get full output.
|
# Break CGI reading after 1 second. We must get full output.
|
||||||
# Since CGI script does sleep, we sleep as well and increase request count
|
# Since CGI script does sleep, we sleep as well and increase request count
|
||||||
# manually.
|
# manually.
|
||||||
fail('Slow CGI output forward ') unless
|
my $slow_cgi_reply;
|
||||||
req("GET /timeout.cgi HTTP/1.0\r\n\r\n", 0, 1) =~ /Some data/s;
|
print "==> Slow CGI output ... ";
|
||||||
|
fail('Slow CGI output forward reply=', $slow_cgi_reply) unless
|
||||||
|
($slow_cgi_reply = req("GET /timeout.cgi HTTP/1.0\r\n\r\n", 0, 1)) =~ /Some data/s;
|
||||||
|
print "OK\n";
|
||||||
sleep 3;
|
sleep 3;
|
||||||
$num_requests++;
|
$num_requests++;
|
||||||
|
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env perl
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
# Make stdout unbuffered
|
# Make stdout unbuffered
|
||||||
$| = 1;
|
use FileHandle;
|
||||||
|
STDOUT->autoflush(1);
|
||||||
|
|
||||||
# This script outputs some content, then sleeps for 5 seconds, then exits.
|
# This script outputs some content, then sleeps for 5 seconds, then exits.
|
||||||
# Web server should return the content immediately after it is sent,
|
# Web server should return the content immediately after it is sent,
|
||||||
|
Reference in New Issue
Block a user