diff options
author | AlexSm <alex@ydb.tech> | 2024-01-18 11:28:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 11:28:56 +0100 |
commit | 9d0a3761b3201e0d9db879a7adf91876ebdb0564 (patch) | |
tree | 541d11ac878c18efd7ebca81e35112aa0fef995b /contrib/libs/curl/src/tool_setopt.c | |
parent | 404ef8886ecc9736bc58ade6da2fbd83b486a408 (diff) | |
download | ydb-9d0a3761b3201e0d9db879a7adf91876ebdb0564.tar.gz |
Library import 8 (#1074)
* Library import 8
* Add contrib/libs/cxxsupp/libcxx/include/__verbose_abort
Diffstat (limited to 'contrib/libs/curl/src/tool_setopt.c')
-rw-r--r-- | contrib/libs/curl/src/tool_setopt.c | 63 |
1 files changed, 10 insertions, 53 deletions
diff --git a/contrib/libs/curl/src/tool_setopt.c b/contrib/libs/curl/src/tool_setopt.c index 3db2fe3c68..de3b78fab5 100644 --- a/contrib/libs/curl/src/tool_setopt.c +++ b/contrib/libs/curl/src/tool_setopt.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -91,6 +91,7 @@ const struct NameValue setopt_nv_CURL_HTTP_VERSION[] = { NV(CURL_HTTP_VERSION_2_0), NV(CURL_HTTP_VERSION_2TLS), NV(CURL_HTTP_VERSION_3), + NV(CURL_HTTP_VERSION_3ONLY), NVEND, }; @@ -293,51 +294,9 @@ CURLcode tool_setopt_enum(CURL *curl, struct GlobalConfig *config, #ifdef DEBUGBUILD if(ret) - warnf(config, "option %s returned error (%d)\n", name, (int)ret); + warnf(config, "option %s returned error (%d)", name, (int)ret); #endif - nomem: - return ret; -} - -/* setopt wrapper for flags */ -CURLcode tool_setopt_flags(CURL *curl, struct GlobalConfig *config, - const char *name, CURLoption tag, - const struct NameValue *nvlist, long lval) -{ - CURLcode ret = CURLE_OK; - bool skip = FALSE; - - ret = curl_easy_setopt(curl, tag, lval); - if(!lval) - skip = TRUE; - - if(config->libcurl && !skip && !ret) { - /* we only use this for real if --libcurl was used */ - char preamble[80]; /* should accommodate any symbol name */ - long rest = lval; /* bits not handled yet */ - const struct NameValue *nv = NULL; - msnprintf(preamble, sizeof(preamble), - "curl_easy_setopt(hnd, %s, ", name); - for(nv = nvlist; nv->name; nv++) { - if((nv->value & ~ rest) == 0) { - /* all value flags contained in rest */ - rest &= ~ nv->value; /* remove bits handled here */ - CODE3("%s(long)%s%s", - preamble, nv->name, rest ? " |" : ");"); - if(!rest) - break; /* handled them all */ - /* replace with all spaces for continuation line */ - msnprintf(preamble, sizeof(preamble), "%*s", strlen(preamble), ""); - } - } - /* If any bits have no definition, output an explicit value. - * This could happen if new bits are defined and used - * but the NameValue list is not updated. */ - if(rest) - CODE2("%s%ldL);", preamble, rest); - } - - nomem: +nomem: return ret; } @@ -370,7 +329,8 @@ CURLcode tool_setopt_bitmask(CURL *curl, struct GlobalConfig *config, if(!rest) break; /* handled them all */ /* replace with all spaces for continuation line */ - msnprintf(preamble, sizeof(preamble), "%*s", strlen(preamble), ""); + msnprintf(preamble, sizeof(preamble), "%*s", (int)strlen(preamble), + ""); } } /* If any bits have no definition, output an explicit value. @@ -380,7 +340,7 @@ CURLcode tool_setopt_bitmask(CURL *curl, struct GlobalConfig *config, CODE2("%s%luUL);", preamble, rest); } - nomem: +nomem: return ret; } @@ -406,7 +366,7 @@ static CURLcode libcurl_generate_slist(struct curl_slist *slist, int *slistno) *slistno, *slistno, escaped); } - nomem: +nomem: Curl_safefree(escaped); return ret; } @@ -589,7 +549,7 @@ CURLcode tool_setopt_slist(CURL *curl, struct GlobalConfig *config, CODE2("curl_easy_setopt(hnd, %s, slist%d);", name, i); } - nomem: +nomem: return ret; } @@ -703,14 +663,11 @@ CURLcode tool_setopt(CURL *curl, bool str, struct GlobalConfig *global, } } - nomem: +nomem: Curl_safefree(escaped); return ret; } #else /* CURL_DISABLE_LIBCURL_OPTION */ -#include "tool_cfgable.h" -#include "tool_setopt.h" - #endif /* CURL_DISABLE_LIBCURL_OPTION */ |