summaryrefslogtreecommitdiff
path: root/lib/share.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-11-01 23:37:45 +0100
committerDaniel Stenberg <daniel@haxx.se>2017-11-09 11:07:44 +0100
commit67c55a26d51149650e91a00b63cf5107989a57e9 (patch)
treeb041c360056052d48a51585153ab4cb9c8a4e354 /lib/share.c
parente871ab56ed9cb0f3ab00b40e188f51cfb37b96cd (diff)
downloadcurl-67c55a26d51149650e91a00b63cf5107989a57e9.tar.gz
share: add support for sharing the connection cache
Diffstat (limited to 'lib/share.c')
-rw-r--r--lib/share.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/share.c b/lib/share.c
index 5b3957fcf..c1ce1aab1 100644
--- a/lib/share.c
+++ b/lib/share.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2017, 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
@@ -102,6 +102,8 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...)
break;
case CURL_LOCK_DATA_CONNECT: /* not supported (yet) */
+ if(Curl_conncache_init(&share->conn_cache, 103))
+ return CURLSHE_NOMEM;
break;
default:
@@ -186,6 +188,8 @@ curl_share_cleanup(struct Curl_share *share)
return CURLSHE_IN_USE;
}
+ 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)