summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-02-09 15:46:41 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-02-17 22:32:01 +0100
commit1c3c0162c62e2788373261a43f484ff401017d8a (patch)
tree4ab9b9b3e7ceb5db385c1e7377f4ffed7d14a597 /include
parenta40f58d2efac45dad7e12ea53870f42c825bcf0d (diff)
downloadcurl-1c3c0162c62e2788373261a43f484ff401017d8a.tar.gz
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.
Diffstat (limited to 'include')
-rw-r--r--include/curl/curl.h7
1 files changed, 7 insertions, 0 deletions
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);