Skip to content

Commit b871386

Browse files
authored
Add debug information to setopt commands (#248)
1 parent 51e5321 commit b871386

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Curl/Curl.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,21 @@ end
103103
104104
Sets options on libcurl's "easy" interface. `option` corresponds to libcurl options on https://curl.se/libcurl/c/curl_easy_setopt.html
105105
"""
106-
setopt(easy::Easy, option::Integer, value) =
107-
@check curl_easy_setopt(easy.handle, option, value)
106+
function setopt(easy::Easy, option::Integer, value)
107+
res = @check curl_easy_setopt(easy.handle, option, value)
108+
@debug "Easy setopt: $(option) = $(value) (res: $(res))"
109+
return res
110+
end
108111

109112
"""
110113
setopt(multi::Multi, option::Integer, value)
111114
112115
Sets options on libcurl's "multi" interface. `option` corresponds to libcurl options on https://curl.se/libcurl/c/curl_multi_setopt.html
113116
"""
114-
setopt(multi::Multi, option::Integer, value) =
115-
@check curl_multi_setopt(multi.handle, option, value)
117+
function setopt(multi::Multi, option::Integer, value)
118+
res = @check curl_multi_setopt(multi.handle, option, value)
119+
@debug "Multi setopt: $(option) = $(value) (res: $(res))"
120+
return res
121+
end
116122

117123
end # module

0 commit comments

Comments
 (0)