cURL / Mailing Lists / curl-library / Single Mail


Aborting from progress callback during connection doesn't work

From: Adam Light <>
Date: Mon, 9 Aug 2010 11:16:43 -0700

I'm using libcurl 7.21.0 in my application. I have a progress
callback function which makes a call to my application to see if it
should tell libcurl to abort. The progress function works fine during
a transfer, but if the progress function is called during the connect
phase and returns a non-zero value, libcurl does not abort the
connection attempt. This is using the easy interface.

I have stepped through the libcurl code in the debugger and it looks
to me like the problem is in the singleipconnect() function. The
waitconnect() function returns CURLE_ABORTED_BY_CALLBACK but then
singleipconnect() doesn't do anything with that return code.
singleipconnect() does return CURL_SOCKET_BAD when this happens, but
the calling function, Curl_connecthost(), tries again instead of

I assume this behavior is not intentional, and therefore a bug. I'm
not sure whether it's best fixed from singleipconnect() or

Adam Light
List admin:
Received on 2010-08-09