diff options
author | thegeorg <thegeorg@yandex-team.com> | 2024-10-11 21:07:18 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2024-10-11 21:17:24 +0300 |
commit | 1df197e6035ea9826bfedee7d48812e318ba9c7a (patch) | |
tree | 76b8e9de41820755adf209854d06a84a8b5a1988 /contrib/libs/curl/lib/share.c | |
parent | f9c007ea1b59b960201def74990810b26ecdfd48 (diff) | |
download | ydb-1df197e6035ea9826bfedee7d48812e318ba9c7a.tar.gz |
Revert "Update contrib/libs/curl to 8.10.1" to fix
Revert "Update contrib/libs/curl to 8.10.1"
This reverts commit 428ef806a15515cdaa325530aa8cc6903fac5fb6, reversing
changes made to 40e46e6394df409d1545a3771c8a47a86ed55eac.
Revert "Fix formatting after rXXXXXX"
This reverts commit a73689311a92e195d14136c5a0049ef1e40b1f3e, reversing
changes made to 17980b8756d1f74d3dacddc7ca4945c30f35611c.
commit_hash:5c5194831e5455b61fbee61619066396626beab1
Diffstat (limited to 'contrib/libs/curl/lib/share.c')
-rw-r--r-- | contrib/libs/curl/lib/share.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/contrib/libs/curl/lib/share.c b/contrib/libs/curl/lib/share.c index 2ddaba6d7e..c0a8d806f3 100644 --- a/contrib/libs/curl/lib/share.c +++ b/contrib/libs/curl/lib/share.c @@ -26,12 +26,10 @@ #include <curl/curl.h> #include "urldata.h" -#include "connect.h" #include "share.h" #include "psl.h" #include "vtls/vtls.h" #include "hsts.h" -#include "url.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" @@ -66,7 +64,7 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...) return CURLSHE_INVALID; if(share->dirty) - /* do not allow setting options while one or more handles are already + /* don't allow setting options while one or more handles are already using this share */ return CURLSHE_IN_USE; @@ -121,12 +119,8 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...) break; case CURL_LOCK_DATA_CONNECT: - /* It is safe to set this option several times on a share. */ - if(!share->cpool.idata) { - if(Curl_cpool_init(&share->cpool, Curl_on_disconnect, - NULL, share, 103)) - res = CURLSHE_NOMEM; - } + if(Curl_conncache_init(&share->conn_cache, 103)) + res = CURLSHE_NOMEM; break; case CURL_LOCK_DATA_PSL: @@ -139,13 +133,13 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...) res = CURLSHE_BAD_OPTION; } if(!res) - share->specifier |= (unsigned int)(1<<type); + share->specifier |= (1<<type); break; case CURLSHOPT_UNSHARE: /* this is a type this share will no longer share */ type = va_arg(param, int); - share->specifier &= ~(unsigned int)(1<<type); + share->specifier &= ~(1<<type); switch(type) { case CURL_LOCK_DATA_DNS: break; @@ -229,9 +223,8 @@ curl_share_cleanup(struct Curl_share *share) return CURLSHE_IN_USE; } - if(share->specifier & (1 << CURL_LOCK_DATA_CONNECT)) { - Curl_cpool_destroy(&share->cpool); - } + Curl_conncache_close_all_connections(&share->conn_cache); + Curl_conncache_destroy(&share->conn_cache); Curl_hash_destroy(&share->hostcache); #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) @@ -271,11 +264,11 @@ Curl_share_lock(struct Curl_easy *data, curl_lock_data type, if(!share) return CURLSHE_INVALID; - if(share->specifier & (unsigned int)(1<<type)) { + if(share->specifier & (1<<type)) { if(share->lockfunc) /* only call this if set! */ share->lockfunc(data, type, accesstype, share->clientdata); } - /* else if we do not share this, pretend successful lock */ + /* else if we don't share this, pretend successful lock */ return CURLSHE_OK; } @@ -288,7 +281,7 @@ Curl_share_unlock(struct Curl_easy *data, curl_lock_data type) if(!share) return CURLSHE_INVALID; - if(share->specifier & (unsigned int)(1<<type)) { + if(share->specifier & (1<<type)) { if(share->unlockfunc) /* only call this if set! */ share->unlockfunc (data, type, share->clientdata); } |