From b370fcd300902d1310696088decf53ee2a286b95 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 9 Feb 2011 15:36:36 +0100 Subject: [PATCH] CURLOPT_SOCKOPTFUNCTION: return proper error code When the callback returns an error, this function must make sure to return CURLE_ABORTED_BY_CALLBACK properly and not CURLE_OK as before to allow the callback to properly abort the operation. --- lib/connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/connect.c b/lib/connect.c index bcc1ed74a..fb21fb7df 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -926,7 +926,7 @@ singleipconnect(struct connectdata *conn, CURLSOCKTYPE_IPCXN); if(error) { sclose(sockfd); /* close the socket and bail out */ - return res; + return CURLE_ABORTED_BY_CALLBACK; } }