Lines Matching refs:share
44 struct Curl_share *share = calloc(1, sizeof(struct Curl_share)); in curl_share_init() local
45 if(share) { in curl_share_init()
46 share->magic = CURL_GOOD_SHARE; in curl_share_init()
47 share->specifier |= (1 << CURL_LOCK_DATA_SHARE); in curl_share_init()
48 Curl_init_dnscache(&share->hostcache, 23); in curl_share_init()
51 return share; in curl_share_init()
64 struct Curl_share *share = sh; in curl_share_setopt() local
66 if(!GOOD_SHARE_HANDLE(share)) in curl_share_setopt()
69 if(share->dirty) in curl_share_setopt()
87 if(!share->cookies) { in curl_share_setopt()
88 share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE); in curl_share_setopt()
89 if(!share->cookies) in curl_share_setopt()
99 if(!share->hsts) { in curl_share_setopt()
100 share->hsts = Curl_hsts_init(); in curl_share_setopt()
101 if(!share->hsts) in curl_share_setopt()
111 if(!share->sslsession) { in curl_share_setopt()
112 share->max_ssl_sessions = 8; in curl_share_setopt()
113 share->sslsession = calloc(share->max_ssl_sessions, in curl_share_setopt()
115 share->sessionage = 0; in curl_share_setopt()
116 if(!share->sslsession) in curl_share_setopt()
126 if(!share->cpool.idata) { in curl_share_setopt()
127 if(Curl_cpool_init(&share->cpool, Curl_on_disconnect, in curl_share_setopt()
128 NULL, share, 103)) in curl_share_setopt()
143 share->specifier |= (unsigned int)(1 << type); in curl_share_setopt()
149 share->specifier &= ~(unsigned int)(1 << type); in curl_share_setopt()
156 if(share->cookies) { in curl_share_setopt()
157 Curl_cookie_cleanup(share->cookies); in curl_share_setopt()
158 share->cookies = NULL; in curl_share_setopt()
167 if(share->hsts) { in curl_share_setopt()
168 Curl_hsts_cleanup(&share->hsts); in curl_share_setopt()
177 Curl_safefree(share->sslsession); in curl_share_setopt()
194 share->lockfunc = lockfunc; in curl_share_setopt()
199 share->unlockfunc = unlockfunc; in curl_share_setopt()
204 share->clientdata = ptr; in curl_share_setopt()
220 struct Curl_share *share = sh; in curl_share_cleanup() local
221 if(!GOOD_SHARE_HANDLE(share)) in curl_share_cleanup()
224 if(share->lockfunc) in curl_share_cleanup()
225 share->lockfunc(NULL, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE, in curl_share_cleanup()
226 share->clientdata); in curl_share_cleanup()
228 if(share->dirty) { in curl_share_cleanup()
229 if(share->unlockfunc) in curl_share_cleanup()
230 share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata); in curl_share_cleanup()
234 if(share->specifier & (1 << CURL_LOCK_DATA_CONNECT)) { in curl_share_cleanup()
235 Curl_cpool_destroy(&share->cpool); in curl_share_cleanup()
237 Curl_hash_destroy(&share->hostcache); in curl_share_cleanup()
240 Curl_cookie_cleanup(share->cookies); in curl_share_cleanup()
244 Curl_hsts_cleanup(&share->hsts); in curl_share_cleanup()
248 if(share->sslsession) { in curl_share_cleanup()
250 for(i = 0; i < share->max_ssl_sessions; i++) in curl_share_cleanup()
251 Curl_ssl_kill_session(&(share->sslsession[i])); in curl_share_cleanup()
252 free(share->sslsession); in curl_share_cleanup()
256 Curl_psl_destroy(&share->psl); in curl_share_cleanup()
258 if(share->unlockfunc) in curl_share_cleanup()
259 share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata); in curl_share_cleanup()
260 share->magic = 0; in curl_share_cleanup()
261 free(share); in curl_share_cleanup()
271 struct Curl_share *share = data->share; in Curl_share_lock() local
273 if(!share) in Curl_share_lock()
276 if(share->specifier & (unsigned int)(1 << type)) { in Curl_share_lock()
277 if(share->lockfunc) /* only call this if set! */ in Curl_share_lock()
278 share->lockfunc(data, type, accesstype, share->clientdata); in Curl_share_lock()
288 struct Curl_share *share = data->share; in Curl_share_unlock() local
290 if(!share) in Curl_share_unlock()
293 if(share->specifier & (unsigned int)(1 << type)) { in Curl_share_unlock()
294 if(share->unlockfunc) /* only call this if set! */ in Curl_share_unlock()
295 share->unlockfunc (data, type, share->clientdata); in Curl_share_unlock()