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

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Wed, 08 Sep 2010 07:35:00 +0000

Bugs item #3061535, was opened at 2010-09-08 00:05
Message generated for change (Comment added) made by bagder
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: 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: Daniel Stenberg (bagder)
Date: 2010-09-08 09:35

Message:
man if I could just read the description properly I would've realized that
you indeed added time to the connection phase, sorry, but I'll stop
spamming this with stupid comments now and instead try to find some time to
work on this issue. I'll get back in a day or two I hope.

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

Comment By: Daniel Stenberg (bagder)
Date: 2010-09-08 09:32

Message:
I've updated the summary since this clearly is not the connect time you see
added. Connecting to localhost is done in milliseconds.

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

Comment By: Rodric Glaser (rodricg)
Date: 2010-09-08 00: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