]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLOPT_SOCKOPTFUNCTION: return proper error code
authorDaniel Stenberg <daniel@haxx.se>
Wed, 9 Feb 2011 14:36:36 +0000 (15:36 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 9 Feb 2011 14:36:36 +0000 (15:36 +0100)
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

index bcc1ed74ab841b11fa47e0530cf205ad004847a3..fb21fb7df5a38150d9fe8f2ce35e8946e1abddba 100644 (file)
@@ -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;
     }
   }