From b5d170b55110bacc61a4aa8bf99df1afc303c5dc Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 16 May 2011 23:46:43 +0200 Subject: CLOSESOCKETFUNCTION: added Introduced the initial setup to allow closesocket callbacks by making sure sclose() is only ever called from one place in the libcurl source and still run all test cases fine. --- include/curl/curl.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/curl/curl.h b/include/curl/curl.h index 09f305466..e4fbfdf89 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -341,6 +341,9 @@ typedef curl_socket_t curlsocktype purpose, struct curl_sockaddr *address); +typedef void +(*curl_closesocket_callback)(void *clientp, curl_socket_t item); + typedef enum { CURLIOE_OK, /* I/O operation successful */ CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ @@ -1475,6 +1478,11 @@ typedef enum { */ CINIT(TRANSFER_ENCODING, LONG, 207), + /* Callback function for closing socket (instead of close(2)). The callback + should have type curl_closesocket_callback */ + CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208), + CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209), + CURLOPT_LASTENTRY /* the last unused */ } CURLoption; -- cgit v1.2.3