From 211abf28ea6ff067776caacf97287e97ab21acac Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Sat, 18 Jun 2022 11:33:51 +0200 Subject: [PATCH 1/2] curl/multi: handle timer_callback correctly As per libcurl documentation: > A timeout_ms value of -1 passed to this callback means you should > delete the timer. All other values are valid expire times in number of > milliseconds. Adjust the code to match this. --- src/core/net/http/impl/curl/multi.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/net/http/impl/curl/multi.cpp b/src/core/net/http/impl/curl/multi.cpp index fd7d534..acfa8a1 100644 --- a/src/core/net/http/impl/curl/multi.cpp +++ b/src/core/net/http/impl/curl/multi.cpp @@ -428,8 +428,9 @@ int multi::Handle::Private::timer_callback( long timeout_ms, void* cookie) { - if (timeout_ms < 0) - return -1; + /* -1 means we should just delete our timer. */ + if (timeout_ms == -1) + return 0; auto holder = static_cast(cookie); -- 2.36.1