Skip to content

Commit

Permalink
Add debug information to setopt commands (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano authored Jul 15, 2024
1 parent 51e5321 commit b871386
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Curl/Curl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,21 @@ end
Sets options on libcurl's "easy" interface. `option` corresponds to libcurl options on https://curl.se/libcurl/c/curl_easy_setopt.html
"""
setopt(easy::Easy, option::Integer, value) =
@check curl_easy_setopt(easy.handle, option, value)
function setopt(easy::Easy, option::Integer, value)
res = @check curl_easy_setopt(easy.handle, option, value)
@debug "Easy setopt: $(option) = $(value) (res: $(res))"
return res
end

"""
setopt(multi::Multi, option::Integer, value)
Sets options on libcurl's "multi" interface. `option` corresponds to libcurl options on https://curl.se/libcurl/c/curl_multi_setopt.html
"""
setopt(multi::Multi, option::Integer, value) =
@check curl_multi_setopt(multi.handle, option, value)
function setopt(multi::Multi, option::Integer, value)
res = @check curl_multi_setopt(multi.handle, option, value)
@debug "Multi setopt: $(option) = $(value) (res: $(res))"
return res
end

end # module

0 comments on commit b871386

Please sign in to comment.