cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-3061535 ] Connect time not included in CURLOPT_TIMEOUT

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Tue, 07 Sep 2010 22:49:16 +0000

Bugs item #3061535, was opened at 2010-09-07 15:05
Message generated for change (Comment added) made by rodricg
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3061535&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: http
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Rodric Glaser (rodricg)
Assigned to: Daniel Stenberg (bagder)
Summary: Connect time not included in CURLOPT_TIMEOUT

Initial Comment:
Curl will not abort the operation until <connect time> + CURLOPT_TIMEOUT.

Testing this is a bit involved. I am using:
- The attached multi.php script which hits http://127.0.0.1:82/
- http://127.0.0.1:82/index.php which just sleeps
- The delay-net.pl from http://people.redhat.com/berrange/notes/network-delay.html with a 1.5 second delay
- To delay the initial connect the rule: iptables -I INPUT -i lo -p tcp -m tcp --dport 82 --syn -j QUEUE

Running multi.php then results in:
>php -f "multi.php"
Resource id #5: 28 (Operation timed out after 2000 milliseconds with 0 bytes received)
TotalTime: 3.5011 seconds

I gather this is not the expected behavior based on http://curl.haxx.se/mail/lib-2010-06/0087.html

I have yet to test this with a non php client (my c is rusty) but I have seen the same behavior with:
- curl 7.19.7 (ubuntu php)
- curl 7.20.1 (sabayon php)
- curl 7.21.1 (manual compile)

----------------------------------------------------------------------

>Comment By: Rodric Glaser (rodricg)
Date: 2010-09-07 15:49

Message:
Silly me, its much easier to use:

time curl http://127.0.0.1:82/ --connect-timeout 3 --max-time 4
curl: (28) Operation timed out after 4000 milliseconds with 0 bytes
received

real 0m5.511s
user 0m0.000s
sys 0m0.010s

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3061535&group_id=976
Received on 2010-09-08

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET