Lines Matching refs:share
38 struct Curl_share *share = calloc(1, sizeof(struct Curl_share)); in curl_share_init() local
39 if(share) { in curl_share_init()
40 share->specifier |= (1<<CURL_LOCK_DATA_SHARE); in curl_share_init()
42 if(Curl_mk_dnscache(&share->hostcache)) { in curl_share_init()
43 free(share); in curl_share_init()
48 return share; in curl_share_init()
53 curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...) in curl_share_setopt() argument
62 if(share->dirty) in curl_share_setopt()
80 if(!share->cookies) { in curl_share_setopt()
81 share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE); in curl_share_setopt()
82 if(!share->cookies) in curl_share_setopt()
92 if(!share->sslsession) { in curl_share_setopt()
93 share->max_ssl_sessions = 8; in curl_share_setopt()
94 share->sslsession = calloc(share->max_ssl_sessions, in curl_share_setopt()
96 share->sessionage = 0; in curl_share_setopt()
97 if(!share->sslsession) in curl_share_setopt()
106 if(Curl_conncache_init(&share->conn_cache, 103)) in curl_share_setopt()
120 share->specifier |= (1<<type); in curl_share_setopt()
126 share->specifier &= ~(1<<type); in curl_share_setopt()
133 if(share->cookies) { in curl_share_setopt()
134 Curl_cookie_cleanup(share->cookies); in curl_share_setopt()
135 share->cookies = NULL; in curl_share_setopt()
144 Curl_safefree(share->sslsession); in curl_share_setopt()
161 share->lockfunc = lockfunc; in curl_share_setopt()
166 share->unlockfunc = unlockfunc; in curl_share_setopt()
171 share->clientdata = ptr; in curl_share_setopt()
185 curl_share_cleanup(struct Curl_share *share) in curl_share_cleanup() argument
187 if(share == NULL) in curl_share_cleanup()
190 if(share->lockfunc) in curl_share_cleanup()
191 share->lockfunc(NULL, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE, in curl_share_cleanup()
192 share->clientdata); in curl_share_cleanup()
194 if(share->dirty) { in curl_share_cleanup()
195 if(share->unlockfunc) in curl_share_cleanup()
196 share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata); in curl_share_cleanup()
200 Curl_conncache_close_all_connections(&share->conn_cache); in curl_share_cleanup()
201 Curl_conncache_destroy(&share->conn_cache); in curl_share_cleanup()
202 Curl_hash_destroy(&share->hostcache); in curl_share_cleanup()
205 Curl_cookie_cleanup(share->cookies); in curl_share_cleanup()
209 if(share->sslsession) { in curl_share_cleanup()
211 for(i = 0; i < share->max_ssl_sessions; i++) in curl_share_cleanup()
212 Curl_ssl_kill_session(&(share->sslsession[i])); in curl_share_cleanup()
213 free(share->sslsession); in curl_share_cleanup()
217 Curl_psl_destroy(&share->psl); in curl_share_cleanup()
219 if(share->unlockfunc) in curl_share_cleanup()
220 share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata); in curl_share_cleanup()
221 free(share); in curl_share_cleanup()
231 struct Curl_share *share = data->share; in Curl_share_lock() local
233 if(share == NULL) in Curl_share_lock()
236 if(share->specifier & (1<<type)) { in Curl_share_lock()
237 if(share->lockfunc) /* only call this if set! */ in Curl_share_lock()
238 share->lockfunc(data, type, accesstype, share->clientdata); in Curl_share_lock()
248 struct Curl_share *share = data->share; in Curl_share_unlock() local
250 if(share == NULL) in Curl_share_unlock()
253 if(share->specifier & (1<<type)) { in Curl_share_unlock()
254 if(share->unlockfunc) /* only call this if set! */ in Curl_share_unlock()
255 share->unlockfunc (data, type, share->clientdata); in Curl_share_unlock()