From 67c55a26d51149650e91a00b63cf5107989a57e9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 1 Nov 2017 23:37:45 +0100 Subject: share: add support for sharing the connection cache --- lib/share.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/share.c') 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, , et al. + * Copyright (C) 1998 - 2017, Daniel Stenberg, , 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) -- cgit v1.2.3