aboutsummaryrefslogtreecommitdiff
path: root/lib/share.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-08-04 15:02:42 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-08-04 15:02:42 +0000
commit41ae97e710f728495a1d6adba6476c21b94c4881 (patch)
treea7805b39c4d531e8f4b36351d2fed66700c95e2b /lib/share.c
parentf72ba7f79d3eb261f922d24072409ee300402059 (diff)
Dirk Manske's patch that introduces cookie support to the share interface.
Diffstat (limited to 'lib/share.c')
-rw-r--r--lib/share.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/share.c b/lib/share.c
index 798a0a497..9b5f79f9e 100644
--- a/lib/share.c
+++ b/lib/share.c
@@ -76,6 +76,9 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
break;
case CURL_LOCK_DATA_COOKIE:
+ if (!share->cookies) {
+ share->cookies = Curl_cookie_init( NULL, NULL, TRUE );
+ }
break;
case CURL_LOCK_DATA_SSL_SESSION:
@@ -103,6 +106,10 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
break;
case CURL_LOCK_DATA_COOKIE:
+ if (share->cookies) {
+ Curl_cookie_cleanup(share->cookies);
+ share->cookies = NULL;
+ }
break;
case CURL_LOCK_DATA_SSL_SESSION:
@@ -144,6 +151,12 @@ CURLSHcode curl_share_cleanup(CURLSH *sh)
if (share->dirty)
return CURLSHE_IN_USE;
+ if(share->hostcache)
+ Curl_hash_destroy(share->hostcache);
+
+ if(share->cookies)
+ Curl_cookie_cleanup(share->cookies);
+
free (share);
return CURLSHE_OK;
@@ -151,7 +164,8 @@ CURLSHcode curl_share_cleanup(CURLSH *sh)
CURLSHcode
-Curl_share_lock(struct SessionHandle *data, curl_lock_data type, curl_lock_access access)
+Curl_share_lock(struct SessionHandle *data, curl_lock_data type,
+ curl_lock_access access)
{
struct Curl_share *share = data->share;