mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 17:31:46 -05:00
share: don't set the share flag it something fails
When asking for a specific feature to be shared in the share object, that bit was previously set unconditionally even if the shared feature failed or otherwise wouldn't work. Closes #5554
This commit is contained in:
parent
38d4abf510
commit
8b4e796775
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -70,7 +70,7 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...)
|
|||||||
case CURLSHOPT_SHARE:
|
case CURLSHOPT_SHARE:
|
||||||
/* this is a type this share will share */
|
/* this is a type this share will share */
|
||||||
type = va_arg(param, int);
|
type = va_arg(param, int);
|
||||||
share->specifier |= (1<<type);
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case CURL_LOCK_DATA_DNS:
|
case CURL_LOCK_DATA_DNS:
|
||||||
break;
|
break;
|
||||||
@ -102,7 +102,7 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...)
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURL_LOCK_DATA_CONNECT: /* not supported (yet) */
|
case CURL_LOCK_DATA_CONNECT:
|
||||||
if(Curl_conncache_init(&share->conn_cache, 103))
|
if(Curl_conncache_init(&share->conn_cache, 103))
|
||||||
res = CURLSHE_NOMEM;
|
res = CURLSHE_NOMEM;
|
||||||
break;
|
break;
|
||||||
@ -116,6 +116,8 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...)
|
|||||||
default:
|
default:
|
||||||
res = CURLSHE_BAD_OPTION;
|
res = CURLSHE_BAD_OPTION;
|
||||||
}
|
}
|
||||||
|
if(!res)
|
||||||
|
share->specifier |= (1<<type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLSHOPT_UNSHARE:
|
case CURLSHOPT_UNSHARE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user