cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curllib on vista?

From: Jamie Lokier <jamie_at_shareable.org>
Date: Wed, 5 Mar 2008 22:23:37 +0000

Jared Wilkin wrote:
> On XP: during an active connection (in the middle of a data transfer),
> if the cable is pulled libcurl detects a broken connection and exits
> gracefully. Libcurl properly detects the broken connection because the
> behavior of select on XP is as it is documented
> (http://msdn2.microsoft.com/en-us/library/ms740141(VS.85).aspx).
>
> On Vista: During an active connection (in the middle of a data
> transfer), if the cable is pulled libcurl does not detect the broken
> connection. The result of this is that libcurl sits in an infinite loop
> (the select call repeatedly returns 0, for timeout, which causes libcurl
> to keep checking). Plugging the cable back in has no effect on this
> loop. I let it run overnight and it never returns. I was not using
> those LOW_SPEED options (which I will look into doing), but aside from
> setting those, is an infinite loop expected behavior?
>
> I have seen this behavior on 3 vista machines, 2 running business and 1
> running home premium. Thanks for all your responses thus far.

This sounds like a libcurl problem, not a Vista or even Windows problem.

You should be able to replicate the stuck behaviour on XP like this:

   +--------+ +--------------------------+ +-----------+
   | | | | | |
   | XP box +-------+ Ethernet switch / router +------------+ The world |
   | | | | ^ | |
   +--------+ +--------------------------+ | +-----------+
                                                      |
                                               Unplug this cable

Instead of unpluging the cable to the XP box itself, unplug a cable on
the other side of your switch / router.

Then it should have the same behaviour as Vista (which is the same on
most systems): the TCP/IP connection stalls with no data, but no
aborted connection.

It sounds like you want libcurl to time out after no data is
sent/received for a while, and it isn't doing that.

-- Jamie
Received on 2008-03-05