curl: Make socket callback during cleanup into no-op
authorColin Walters <walters@verbum.org>
Wed, 18 Sep 2024 17:41:59 +0000 (13:41 -0400)
committerColin Walters <walters@verbum.org>
Wed, 18 Sep 2024 21:41:41 +0000 (17:41 -0400)
commit4d755a85225ea0a02d4580d088bb8a97138cb040
tree37b4e6a93f57699e605184e8df8d58010ea35b38
parent2945165ffecc0afc1e29b70f58188aaef062d6fd
curl: Make socket callback during cleanup into no-op

Because curl_multi_cleanup may invoke callbacks, we effectively have
some circular references going on here. See discussion in

https://github.com/curl/curl/issues/14860

Basically what we do is the socket callback libcurl may invoke into a no-op when
we detect we're finalizing. The data structures are owned by this object and
not by the callbacks, and will be destroyed below. Note that
e.g. g_hash_table_unref() may itself invoke callbacks, which is where
some data is cleaned up.

Signed-off-by: Colin Walters <walters@verbum.org>
src/libostree/ostree-fetcher-curl.c