diff --git a/src/Curl/Easy.jl b/src/Curl/Easy.jl index 8128c24..8ad57fa 100644 --- a/src/Curl/Easy.jl +++ b/src/Curl/Easy.jl @@ -1,7 +1,7 @@ mutable struct Easy handle :: Ptr{Cvoid} input :: IO - ready :: Threads.Event + done :: Threads.Event seeker :: Union{Function,Nothing} output :: IO progress :: Function diff --git a/src/Curl/Multi.jl b/src/Curl/Multi.jl index 6b9d2aa..bc74955 100644 --- a/src/Curl/Multi.jl +++ b/src/Curl/Multi.jl @@ -85,7 +85,7 @@ function check_multi_info(multi::Multi) easy = unsafe_pointer_to_objref(easy_p_ref[])::Easy @assert easy_handle == easy.handle easy.code = message.code - notify(easy.ready) + notify(easy.done) else @async @error("curl_multi_info_read: unknown message", message) end diff --git a/src/Downloads.jl b/src/Downloads.jl index d71e550..f6ec990 100644 --- a/src/Downloads.jl +++ b/src/Downloads.jl @@ -343,10 +343,8 @@ function request( # do the request add_handle(downloader.multi, easy) - try wait(easy.ready) # can this throw? - finally - remove_handle(downloader.multi, easy) - end + wait(easy.done) + remove_handle(downloader.multi, easy) # return the response or throw an error response = Response(get_response_info(easy)...)