Skip to content

Commit e692e77

Browse files
authored
Set Multi handle to NULL after calling curl_multi_cleanup (#266)
1 parent 91a71b9 commit e692e77

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Curl/Multi.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,18 @@ function done!(multi::Multi)
2525
stoptimer!(multi)
2626
handle = multi.handle
2727
handle == C_NULL && return
28-
multi.handle = C_NULL
29-
curl_multi_cleanup(handle)
28+
# Starting from LibCURL v8.10 we have to keep the handle non-NULL before calling the
29+
# cleanup function (<https://github.com/JuliaLang/Downloads.jl/issues/260>), but doing
30+
# so with Curl v8.10 causes an assertion failure
31+
# (<https://github.com/JuliaLang/Downloads.jl/issues/260#issuecomment-2452772273>),
32+
# that's fixed only with curl 8.11.
33+
@static if CURL_VERSION < v"8.11"
34+
multi.handle = C_NULL
35+
curl_multi_cleanup(handle)
36+
else
37+
curl_multi_cleanup(handle)
38+
multi.handle = C_NULL
39+
end
3040
nothing
3141
end
3242

0 commit comments

Comments
 (0)