Timeout not working like I would expect
Bob Reveal (breveal@c2o.com)
Wed, 17 Feb 1999 11:05:39 -0600
I have run into the following situation that I believe to be an anomaly
with LWP. I am setting timeout to be 30 seconds for a URL. The URL is
pointing at a 10 Mbyte file which takes some time to download. Normally
it downloads in about 15 seconds. However, I have seen the download
peak at 120 seconds. When the download exceeds 30 seconds, the LWP
timeout does not work the way I would expect. I would expect the
timeout logic to kick in when the elapsed time of the HTTP GET exceeds
the 30 second timeout parameter. When the initial connection is made
within the timeout parameter and successive reads from the server are
within the timeout window, LWP misses the timeout. I wrote the
following cgi to test out this scenario. LWP does not catch this
timeout scenario where the download will take ~600 seconds. Any
thoughts?
#!/usr/local/bin/perl
#
print ("Content-type: text/html\n");
print ("Status: 200 Orl Korrect\n");
print("\n");
$buffer = "";
foreach (0 .. 6000) {
$buffer = $buffer."0";
}
foreach $i (0 .. 60) {
print ("$buffer\n");
sleep 10;
}
exit;