Skip to content

Commit

Permalink
fix: pass curl opt v string parameters as cstring
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Nov 10, 2024
1 parent d4c3fd9 commit b3f9864
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion curl/instructions/easy.v
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ pub fn easy_strerror(err_code state.Ecode) string {
}

pub fn easy_setopt[T](handle &C.CURL, option state.Opt, parameter T) state.Ecode {
return ecode(C.curl_easy_setopt(handle, int(option), parameter))
$if T is string {
return ecode(C.curl_easy_setopt(handle, int(option), parameter.str))
} $else {
return ecode(C.curl_easy_setopt(handle, int(option), parameter))
}
}

pub fn easy_perform(handle &C.CURL) state.Ecode {
Expand Down

0 comments on commit b3f9864

Please # to comment.