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.
This commit is contained in:
Daniel Stenberg 2011-02-09 15:46:41 +01:00
parent a40f58d2ef
commit 1c3c0162c6
3 changed files with 16 additions and 5 deletions

View file

@ -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);