curl-library
[bug report] connect-timeout not working on Windows
Date: Thu, 19 Feb 2009 17:36:12 +0100 (CET)
Hey friends!
We got this bug report submitted today, and since it seems very Windows-
specific I would really appreciate some help here to figure out what we can do
to improve things!
The bug report is inlined below for your convenience:
---------- Forwarded message ----------
Bugs item #2616371, was opened at 2009-02-19 15:01
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2616371&group_id=976
I have been playing around with curl and connection-timeouts on windows. To
test the connect-timeout, i used a second machine with linux and dropped all
packets for the ftp port using iptables. When i try to connect from my Windows
XP SP3 box using "curl.exe --connect-timeout 5 ftp://linuxbox", curl will hang
forever. When i use the "--max-time 5" option instead, it aborts after 5
seconds.
I have traced the packets on the linux box using tcpdump and could see three
SYN-packets. The second was three seconds after the first and the third was
six seconds after the second. No more than three packets arrive, no matter how
long the timeout is set. This seems to be, because the windows default for
retransmissions is "3" (found here:
http://support.microsoft.com/?scid=kb%3Ben-us%3B175523&x=6&y=7 Option
TcpMaxConnectRetransmissions)
So even with "--max-time 50", only three SYN-Packets are sent by the Windows TCP/IP stack. Therefore every timeout greater 20 seconds is useless with windows.
I have tried this with the last-curl version, i found:
curl 7.19.3 (i686-pc-mingw32) libcurl/7.19.3 OpenSSL/0.9.8j zlib/1.2.3 libidn/1.11 libssh2/1.0
Protocols: tftp ftp telnet dict ldap http file https ftps scp sftp
Features: IDN Largefile NTLM SSL libz
To summarize everything:
1. The connect-timeout does not work at all.
2. The max-time option works, but setting it to higher than 20 seconds is useless, because only three SYN-Packets are sent anyway with the default windows setting.
Let me clarify, that i am only talking about the connection phase!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2616371&group_id=976
Received on 2009-02-19