cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[ curl-Bugs-3516508 ] Curl_connecthost brocken

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Wed, 18 Apr 2012 14:16:22 -0700

Bugs item #3516508, was opened at 2012-04-10 07:44
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3516508&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: None
Priority: 5
Private: No
Submitted By: Blaise Potard (blaise2012)
Assigned to: Daniel Stenberg (bagder)
Summary: Curl_connecthost brocken

Initial Comment:
Curl_connecthost will fail immediately if a call to socket() fails.

If the dns resolver returns several records, some of which being unavailable on the system, Curl_connecthost() will fail (and return CURL_FAILED_INIT, which seems wrong) on the first dns record without trying the other records.

I have traced the regression to this commit:

https://github.com/bagder/curl/commit/9109cdec11ee5a19f132fd7bdf2e9ceefea4de41#lib/connect.c

You will observe that the "return CURLE_OK" when the call to socket() fails has been silently replaced by "return CURL_FAILED_INIT"; which do not seem to be the most appropriate error code; furthermore, singleipconnect / Curl_connecthost should be modified appropriately to handle the new behaviour.

Regards,
Blaise

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

>Comment By: Daniel Stenberg (bagder)
Date: 2012-04-18 14:16

Message:
Ok, see the attached patch. It basically restores the old way of working.
Can you verify that it fixes the problem for you?

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

Comment By: Daniel Stenberg (bagder)
Date: 2012-04-17 15:40

Message:
Ack, seems like an entirely correct analysis. Thanks! I'll work on fixing
it.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3516508&group_id=976
Received on 2012-04-18

These mail archives are generated by hypermail.

donate! Page updated January 05, 2012.
web site info

File upload with ASP.NET