From a6d88d774087a1bff90a853e769b307a06de9293 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Mon, 8 Nov 2021 14:25:20 -0500 Subject: [PATCH] Avoid infinite recursion in `timer_callback` Fixes https://github.com/JuliaLang/Downloads.jl/issues/163 --- src/Curl/Multi.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Curl/Multi.jl b/src/Curl/Multi.jl index fc865b0..0ef1b63 100644 --- a/src/Curl/Multi.jl +++ b/src/Curl/Multi.jl @@ -123,9 +123,7 @@ function timer_callback( multi = unsafe_pointer_to_objref(multi_p)::Multi @assert multi_h == multi.handle stoptimer!(multi) - if timeout_ms == 0 - do_multi(multi) - elseif timeout_ms >= 0 + if timeout_ms >= 0 multi.timer = Timer(timeout_ms/1000) do timer lock(multi.lock) do multi.timer === timer || return