@@ -355,7 +355,7 @@ struct static_curl_exports_table {
355355 CURLcode (*curl_easy_recv)(CURL* handle, void* buffer, size_t buflen, size_t* n);
356356 void (*curl_easy_reset)(CURL* handle);
357357 CURLcode (*curl_easy_send)(CURL* handle, const void* buffer, size_t buflen, size_t* n);
358- CURLcode (*curl_easy_setopt)(CURL* handle, const struct curl_easyoption* option, ... );
358+ CURLcode (*curl_easy_setopt)(CURL* handle, const struct curl_easyoption* option, va_list );
359359 CURLcode (*curl_easy_ssls_import)(CURL* handle,
360360 const char* session_key,
361361 const unsigned char* shmac,
@@ -544,6 +544,17 @@ function curl.easy_init()
544544 return handle
545545end
546546
547+ function curl .easy_setopt (handle , name , value )
548+ local option = curl .bindings .curl_easy_option_by_name (name )
549+ assert (option ~= ffi .NULL , " Invalid option name: " .. name ) -- TBD
550+
551+ local status = curl .bindings .curl_easy_setopt (handle , option , value )
552+ if status ~= ffi .C .CURLUE_OK then
553+ -- return nil, curl.curl_easy_strerror(status) -- TBD
554+ end
555+
556+ return status
557+ end
547558function curl .free (pointer )
548559 curl .bindings .curl_free (pointer )
549560end
0 commit comments