cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1224 CONNECTTIMEOUT_MS functionality has been broken since 7.29

From: Andrii Moiseiev <amoiseiev_at_users.sf.net>
Date: Wed, 15 May 2013 19:10:56 +0000

---
** [bugs:#1224] CONNECTTIMEOUT_MS functionality has been broken since 7.29**
**Status:** open
**Created:** Wed May 15, 2013 07:10 PM UTC by Andrii Moiseiev
**Last Updated:** Wed May 15, 2013 07:10 PM UTC
**Owner:** nobody
I found that 7.29 and 7.30 libcurl versions have partly broken CONNECTTIMEOUT_MS functionality. These versions do not respect subseconds and use full-second resolution for timeouts even if compiled against c-ares. 
OS: CentOS 6.3 x86_64
Broken: curl 7.30.0 (x86_64-unknown-linux-gnu) libcurl/7.30.0 OpenSSL/1.0.0 zlib/1.2.3 c-ares/1.9.1 libidn/1.18 libssh2/1.4.3 (the same goes for 7.29)
Good: curl 7.28.1 (x86_64-unknown-linux-gnu) libcurl/7.28.1 OpenSSL/1.0.0 zlib/1.2.3 c-ares/1.9.1 libidn/1.18 libssh2/1.4.3
Configuration options are exactly the same. 
Simple php script to reproduce this: 
::php
<?php
   $url = 'http://8.9.8.9';
   $timeout = 200;
   $connect_timeout = 40;
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, $url);
   curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, $connect_timeout);
   curl_setopt($ch, CURLOPT_TIMEOUT_MS, $timeout);
   curl_exec($ch);
   curl_close($ch);
?>
Trace for 7.28.1 (the good one): 
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
connect(3, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("8.9.8.9")}, 16) = -1 EINPROGRESS (Operation now in progress)
clock_gettime(CLOCK_MONOTONIC, {681218, 818857874}) = 0
clock_gettime(CLOCK_MONOTONIC, {681218, 819188128}) = 0
poll([{fd=3, events=POLLOUT|POLLWRNORM}], 1, 39) = 0 (Timeout)
Trace for 7.30.0 (the bad one): 
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
clock_gettime(CLOCK_MONOTONIC, {681540, 350585044}) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("8.9.8.9")}, 16) = -1 EINPROGRESS (Operation now in progress)
clock_gettime(CLOCK_MONOTONIC, {681540, 351323315}) = 0
clock_gettime(CLOCK_MONOTONIC, {681540, 351379339}) = 0
clock_gettime(CLOCK_MONOTONIC, {681540, 351437113}) = 0
clock_gettime(CLOCK_MONOTONIC, {681540, 351493897}) = 0
poll([{fd=3, events=POLLOUT|POLLWRNORM}], 1, 0) = 0 (Timeout)
clock_gettime(CLOCK_MONOTONIC, {681540, 351618878}) = 0
clock_gettime(CLOCK_MONOTONIC, {681540, 351676111}) = 0
poll([{fd=3, events=POLLOUT}], 1, 1000) = 0 (Timeout)
Let me know if you need any additional info. 
Thanks.
---
Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/curl/bugs/1224/>
To unsubscribe from further messages, please visit <https://sourceforge.net/auth/subscriptions/>
Received on 2013-05-15

These mail archives are generated by hypermail.

donate! Page updated May 06, 2013.
web site info

File upload with ASP.NET