From b3f98647ce95f427652bb68dc708e1ba02ca46f4 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Sun, 10 Nov 2024 23:54:21 +0100 Subject: [PATCH] fix: pass curl opt v string parameters as cstring --- curl/instructions/easy.v | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/curl/instructions/easy.v b/curl/instructions/easy.v index 07c7b69..27151c4 100644 --- a/curl/instructions/easy.v +++ b/curl/instructions/easy.v @@ -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 {