cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURL hangs on connection failure on MAC

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sun, 12 Jun 2005 23:32:56 +0200 (CEST)

On Sat, 11 Jun 2005, Hardeep Singh wrote:

> I am using CURL version 7.12.3.
> I have compiled curl as static library on MAC OS X Panther.
>
> Now when I send HTTP request and before the response comes back from server,
> if I disconnect the network connection the CURL just hangs.

Then this happens because curl doesn't notice any connection break but it
simply waits for traffic.

> It nevers gives the control back to my DLL with or without any error message.

There are different timeout options.

> On Windows, CURL works fine in above scenario and it gives control back with
> error message "CURLE_GOT_NOTHING, /* 52 */".

Well, then for some reason libcurl detected a broken connection. Just not
getting data is not an error in itself, but asking for a document from HTTP
and not getting anything by the time it is closed, is one (error).

> In my code I set the timeout to 180 seconds, but that I think won't be used
> in this case as CURL was able to connect to server.

The regular timeout is unconditional for the whole operation.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-06-12