From 472d9d493a3e4a08415da4c337a7e831e0c5a5e2 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 18 Sep 2024 13:21:27 -0400 Subject: [PATCH] curl: Assert that curl_multi_assign worked ref https://github.com/ostreedev/ostree/issues/3299 This won't fix that issue, but *if* this assertion triggers it should give us a better idea of the possible codepaths where it is happening. Signed-off-by: Colin Walters --- src/libostree/ostree-fetcher-curl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c index d6902893ff..5808c451b4 100644 --- a/src/libostree/ostree-fetcher-curl.c +++ b/src/libostree/ostree-fetcher-curl.c @@ -517,7 +517,8 @@ addsock (curl_socket_t s, CURL *easy, int action, OstreeFetcher *fetcher) fdp->refcount = 1; fdp->fetcher = fetcher; setsock (fdp, s, action, fetcher); - curl_multi_assign (fetcher->multi, s, fdp); + CURLMcode rc = curl_multi_assign (fetcher->multi, s, fdp); + g_assert_cmpint (rc, ==, CURLM_OK); g_hash_table_add (fetcher->sockets, fdp); }