diff --git a/src/handle.c b/src/handle.c index 5746fdfe..361a0f61 100644 --- a/src/handle.c +++ b/src/handle.c @@ -338,7 +338,7 @@ SEXP R_handle_setopt(SEXP ptr, SEXP keys, SEXP values){ error("Value for option %s (%d) must be a number.", optname, key); } assert(curl_easy_setopt(handle, key, (curl_off_t) asReal(val))); - } else if(r_curl_is_string_option(key) || r_curl_is_postfields_option(key)){ + } else if(r_curl_is_postfields_option(key) || r_curl_is_string_option(key)){ switch (TYPEOF(val)) { case RAWSXP: if(key == CURLOPT_POSTFIELDS || key == CURLOPT_COPYPOSTFIELDS) diff --git a/src/typechecking.c b/src/typechecking.c index d1b55b14..648a5536 100644 --- a/src/typechecking.c +++ b/src/typechecking.c @@ -30,8 +30,12 @@ int r_curl_is_off_t_option(CURLoption x){ return _curl_is_off_t_option(x); } +/* workaround old curl bug: if an option is neither classified as string + * stringlist, we assume string: /~https://github.com/jeroen/curl/issues/192 + */ int r_curl_is_string_option(CURLoption x){ - return _curl_is_string_option(x); + return _curl_is_string_option(x) || + (x > 10000 && x < 20000 && !r_curl_is_slist_option(x)); } int r_curl_is_postfields_option(CURLoption x){