From 1c3c0162c62e2788373261a43f484ff401017d8a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 9 Feb 2011 15:46:41 +0100 Subject: SOCKOPTFUNCTION: callback can say already-connected Introducing a few CURL_SOCKOPT* defines for conveniance. The new CURL_SOCKOPT_ALREADY_CONNECTED signals to libcurl that the socket is to be treated as already connected and thus it will skip the connect() call. --- include/curl/curl.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/curl/curl.h b/include/curl/curl.h index 4744f4830..73713dd07 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -315,6 +315,13 @@ typedef enum { CURLSOCKTYPE_LAST /* never use */ } curlsocktype; +/* The return code from the sockopt_callback can signal information back + to libcurl: */ +#define CURL_SOCKOPT_OK 0 +#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return + CURLE_ABORTED_BY_CALLBACK */ +#define CURL_SOCKOPT_ALREADY_CONNECTED 2 + typedef int (*curl_sockopt_callback)(void *clientp, curl_socket_t curlfd, curlsocktype purpose); -- cgit v1.2.3