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-2501457 ] Timeouts not working with curl_multi_socket_action()

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Mon, 12 Jan 2009 17:23:11 +0000

Bugs item #2501457, was opened at 2009-01-12 15:41
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2501457&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: libcurl
Group: wrong behaviour
Status: Open
>Resolution: Later
>Priority: 3
Private: No
Submitted By: Tommie (tomgan)
Assigned to: Daniel Stenberg (bagder)
Summary: Timeouts not working with curl_multi_socket_action()

Initial Comment:
Run this together with

   nc -l -p 9999

I.e. this tests what happens if the web server does not respond in any way
except an initial SYN-ACK.

When running the attached case with curl_multi_perform():

  gcc -DOLD_AND_WORKING=1 -ggdb -Wall `curl-config --cflags` -o curltimeout curltimeout.c `curl-config --libs` && ./curltimeout

a timeout occurs after 2 s as expected. If run with curl_multi_socket_action():

  gcc -DOLD_AND_WORKING=0 -ggdb -Wall `curl-config --cflags` -o curltimeout curltimeout.c `curl-config --libs` && ./curltimeout

there is no timeout. In both cases, curl_multi_timeout() returns -1
in each iteration except the first one.

Tested with 7.16.4 and 7.19.2 on Debian lenny.

My guess is this has something to do with the fact that if "s" is CURL_SOCKET_TIMEOUT,
then "data" is unconditionally NULL in multi_socket(), at multi.c:1825.

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

>Comment By: Daniel Stenberg (bagder)
Date: 2009-01-12 18:23

Message:
This is sort of a known bug, but yes it exists and me knowingly nobody is
working on a fix for this.

The easy work-around is that you keep your own timer and simply remove the
easy handle whenever you want. There's really very little reason to use
libcurl's own timeout feature for this when the multi interface is used.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2501457&group_id=976
Received on 2009-01-12

These mail archives are generated by hypermail.

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

File upload with ASP.NET