cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: possible bug when using socket close callback?

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 03 Mar 2015 13:36:11 -0500

On 2/24/2015 5:53 AM, Frank Meier wrote:
> I just stumbled over some libcurl code, that seems strange to me: in
> function Curl_closesocket() in connect.c the call to
> Curl_multi_closed() is omitted if a socket close function
> (CURLOPT_CLOSESOCKETFUNCTION) is registered.
> My understanding is that the behavior if a registered callback only
> calls close() on the given socket should be the same as if no callback
> was used.
> I havent tested anything, it just caught my eye. So could this be a
> problem?
>
> so I would propose something like:
>
> --- a/lib/connect.c
> +++ b/lib/connect.c
> @@ -1266,6 +1266,7 @@ int Curl_closesocket(struct connectdata *conn,
> status */
> conn->sock_accepted[SECONDARYSOCKET] = FALSE;
> else
> + Curl_multi_closed(conn, sock);
> return conn->fclosesocket(conn->closesocket_client, sock);
> }
>

...bump
Did this slip through the cracks? Looks like a valid point. Also- the
else block needs braces.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-03-03