curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_multi: SOCKETFUNCTION is called to POLL_REMOVE after socket was already closed

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 21 Feb 2019 16:45:39 +0100 (CET)

On Thu, 21 Feb 2019, Pavel Löbl via curl-library wrote:

> I've noticed that SOCKETFUNCTION is called to POLL_REMOVE the socket from
> watched set after the socket was already closed by curl internally.

It does not reproduce for me. I get "epoll_ctl(ADD): File exists" (and then it
exits) because it doesn't seem to update an existing handle, just try to add a
new one already that one is already present.

But I don't think I need to, your description below is excellent:

> I think I've identified the code path. It all starts in
> Curl_disconnect. At first Curl_conncache_remove_conn unlinks easy
> handle from connectdata structure then conn_free is called. conn_free
> calls Curl_closesocket which calls Curl_multi_closed. However
> Curl_multi_closed expects there is still easy handle associated so it
> does nothing (not calling SOCKETFUNCTION).

I think you're spot on. My recent work in properly separating the connections
from transfers caused this regression. I'll get to work and see how I can fix
this!

Thanks!

-- 
  / daniel.haxx.se

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-02-21