cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Curllib on vista?

From: Jared Wilkin <JaredW_at_vulcan.com>
Date: Tue, 4 Mar 2008 14:44:35 -0800

 

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Tuesday, March 04, 2008 1:45 PM
To: libcurl development
Subject: RE: Curllib on vista?

On Tue, 4 Mar 2008, Jared Wilkin wrote:

>> Here the case 0 isn't handled it is the timeout case

>This is not true. It is handled fine. It will call the Curl_readwrite()

>function and if you want a timeout, you set one of those options and
they will
>trigger when the time comes.

>> if you increment a retries counter up to some defined maximum at
which point
>> you return a CURLE_OPERATION_TIMEDOUT error, this produces the
desired
>> effect.

>No, that's not the desired effect since any connection can be idle for
a while
>without it being a problem of any sort.

>The correct solution is either that we detect the broken connection and
then
>abort the transfer. For connections that are broken but not detected
so, the
>already existing timeout options should be good enough.

I see the potential problem with my proposed fix that it can be the case
that a socket is idle for any period of time without being in an error
state. However it is also true that a socket can be active for any
period of time without being in an error state. The reason I didn't use
the existing timeout option to begin with was my app is potentially
transferring large files and thus any set timeout value would have to be
arbitrarily big enough to accommodate, but that also means we have to
wait that long to detect a broken connection. So I guess the issue is
what is the preferred way to detect a closed connection on Vista? The
method that works on XP (where select returns with the read FD set and
then an attempt to read returns 0 bytes read) doesn't work on Vista, Is
there another way to test the socket, perhaps done in the case where
select times out, to see if it is closed?
Received on 2008-03-04