Commit 60f0ebbd authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

CLOSESOCKETFUNCTION: use the callback

Fix the return type of the callback to match close() and make use of it.
parent b5d170b5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ typedef curl_socket_t
                            curlsocktype purpose,
                            struct curl_sockaddr *address);

typedef void
typedef int
(*curl_closesocket_callback)(void *clientp, curl_socket_t item);

typedef enum {
+4 −3
Original line number Diff line number Diff line
@@ -1172,7 +1172,8 @@ curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
int Curl_closesocket(struct connectdata *conn,
                     curl_socket_t sock)
{
  (void)conn;

  if(conn && conn->fclosesocket)
    return conn->fclosesocket(conn->closesocket_client, sock);
  else
    return sclose(sock);
}