From 5acadc9cd7a1ff40ffa8d57214c90d8c788b2b03 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 29 Aug 2006 14:39:33 +0000 Subject: David McCreedy added CURLOPT_SOCKOPTFUNCTION and CURLOPT_SOCKOPTDATA to allow applications to set their own socket options. --- lib/connect.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/connect.c') diff --git a/lib/connect.c b/lib/connect.c index 95fdf8119..4e7f4f8ea 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -702,6 +702,17 @@ singleipconnect(struct connectdata *conn, nosigpipe(conn, sockfd); + if(data->set.fsockopt) { + /* activate callback for setting socket options */ + error = data->set.fsockopt(data->set.sockopt_client, + sockfd, + CURLSOCKTYPE_IPCXN); + if (error) { + sclose(sockfd); /* close the socket and bail out */ + return CURL_SOCKET_BAD; + } + } + /* possibly bind the local end to an IP, interface or port */ res = bindlocal(conn, sockfd); if(res) { -- cgit v1.2.3