@@ -26,13 +26,35 @@ export
2626 remove_handle
2727
2828using LibCURL
29- using LibCURL: curl_off_t
29+ using LibCURL: curl_off_t, libcurl
3030# not exported: https://github.com/JuliaWeb/LibCURL.jl/issues/87
3131
3232# constants that LibCURL should have but doesn't
3333const CURLE_PEER_FAILED_VERIFICATION = 60
3434const CURLSSLOPT_REVOKE_BEST_EFFORT = 1 << 3
3535
36+ # these are incorrectly defined on Windows by LibCURL:
37+ if Sys. iswindows ()
38+ const curl_socket_t = Base. OS_HANDLE
39+ const CURL_SOCKET_TIMEOUT = Base. INVALID_OS_HANDLE
40+ else
41+ const curl_socket_t = Cint
42+ const CURL_SOCKET_TIMEOUT = - 1
43+ end
44+
45+ # definitions affected by incorrect curl_socket_t (copied verbatim):
46+ function curl_multi_socket_action (multi_handle, s, ev_bitmask, running_handles)
47+ ccall ((:curl_multi_socket_action , libcurl), CURLMcode, (Ptr{CURLM}, curl_socket_t, Cint, Ptr{Cint}), multi_handle, s, ev_bitmask, running_handles)
48+ end
49+ function curl_multi_assign (multi_handle, sockfd, sockp)
50+ ccall ((:curl_multi_assign , libcurl), CURLMcode, (Ptr{CURLM}, curl_socket_t, Ptr{Cvoid}), multi_handle, sockfd, sockp)
51+ end
52+
53+ # additional curl_multi_socket_action method
54+ function curl_multi_socket_action (multi_handle, s, ev_bitmask)
55+ curl_multi_socket_action (multi_handle, s, ev_bitmask, Ref {Cint} ())
56+ end
57+
3658using FileWatching
3759using NetworkOptions
3860using Base: OS_HANDLE, preserve_handle, unpreserve_handle
0 commit comments