From 2a2b04caa98a569a5cba5e07384c3038bb62a54e Mon Sep 17 00:00:00 2001 From: uvlad7 Date: Fri, 6 Sep 2024 03:23:28 +0300 Subject: [PATCH] Fix doc comments --- ext/curb_easy.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/ext/curb_easy.c b/ext/curb_easy.c index fe8f895..4497368 100644 --- a/ext/curb_easy.c +++ b/ext/curb_easy.c @@ -3482,9 +3482,16 @@ static VALUE ruby_curl_easy_last_error(VALUE self) { /* * call-seq: - * easy.setopt Fixnum, value => value + * easy.setopt(opt, val) => val * * Initial access to libcurl curl_easy_setopt + * + * @param [Integer] opt The option to set, see +Curl::CURLOPT_*+ constants + * @param [Object] val + * @return [Object] val + * @raise [TypeError] if the option is not supported + * @note Some options - like url or cookie - aren't set directly throught +curl_easy_setopt+, but stored in the Ruby object state. + * @note When +curl_easy_setopt+ is called, return value is not cheched here. */ static VALUE ruby_curl_easy_set_opt(VALUE self, VALUE opt, VALUE val) { ruby_curl_easy *rbce; @@ -3629,11 +3636,6 @@ static VALUE ruby_curl_easy_set_opt(VALUE self, VALUE opt, VALUE val) { curl_easy_setopt(rbce->curl, CURLOPT_TCP_KEEPINTVL, NUM2LONG(val)); break; #endif -#if HAVE_CURLOPT_COOKIELIST - case CURLOPT_COOKIELIST: { - curl_easy_setopt(rbce->curl, CURLOPT_COOKIELIST, StringValueCStr(val)); - } break; -#endif #if HAVE_CURLOPT_HAPROXYPROTOCOL case CURLOPT_HAPROXYPROTOCOL: curl_easy_setopt(rbce->curl, CURLOPT_HAPROXYPROTOCOL, NUM2LONG(val)); @@ -3655,6 +3657,11 @@ static VALUE ruby_curl_easy_set_opt(VALUE self, VALUE opt, VALUE val) { curl_easy_setopt(rbce->curl, CURLOPT_SSL_SESSIONID_CACHE, NUM2LONG(val)); break; #endif +#if HAVE_CURLOPT_COOKIELIST + case CURLOPT_COOKIELIST: { + curl_easy_setopt(rbce->curl, CURLOPT_COOKIELIST, StringValueCStr(val)); + } break; +#endif #if HAVE_CURLOPT_PROXY_SSL_VERIFYHOST case CURLOPT_PROXY_SSL_VERIFYHOST: curl_easy_setopt(rbce->curl, CURLOPT_PROXY_SSL_VERIFYHOST, NUM2LONG(val)); @@ -3669,9 +3676,13 @@ static VALUE ruby_curl_easy_set_opt(VALUE self, VALUE opt, VALUE val) { /* * call-seq: - * easy.getinfo Fixnum => value + * easy.getinfo(opt) => nil * * Iniital access to libcurl curl_easy_getinfo, remember getinfo doesn't return the same values as setopt + * + * @note This method is not implemented yet. + * @param [Fixnum] code Constant +CURLINFO_*+ from libcurl + * @return [nil] */ static VALUE ruby_curl_easy_get_opt(VALUE self, VALUE opt) { return Qnil;