David McCreedy added CURLOPT_SOCKOPTFUNCTION and CURLOPT_SOCKOPTDATA to

allow applications to set their own socket options.
This commit is contained in:
Daniel Stenberg
2006-08-29 14:39:33 +00:00
parent 2ff609dd43
commit 5acadc9cd7
9 changed files with 104 additions and 56 deletions

View File

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