Lines Matching refs:share
37 struct Curl_share *share = calloc(1, sizeof(struct Curl_share)); in curl_share_init() local
38 if(share) { in curl_share_init()
39 share->specifier |= (1<<CURL_LOCK_DATA_SHARE); in curl_share_init()
41 if(Curl_mk_dnscache(&share->hostcache)) { in curl_share_init()
42 free(share); in curl_share_init()
47 return share; in curl_share_init()
54 struct Curl_share *share = (struct Curl_share *)sh; in curl_share_setopt() local
62 if(share->dirty) in curl_share_setopt()
73 share->specifier |= (1<<type); 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()
116 share->specifier &= ~(1<<type); in curl_share_setopt()
123 if(share->cookies) { in curl_share_setopt()
124 Curl_cookie_cleanup(share->cookies); in curl_share_setopt()
125 share->cookies = NULL; in curl_share_setopt()
134 Curl_safefree(share->sslsession); in curl_share_setopt()
151 share->lockfunc = lockfunc; in curl_share_setopt()
156 share->unlockfunc = unlockfunc; in curl_share_setopt()
161 share->clientdata = ptr; in curl_share_setopt()
177 struct Curl_share *share = (struct Curl_share *)sh; in curl_share_cleanup() local
179 if(share == NULL) in curl_share_cleanup()
182 if(share->lockfunc) in curl_share_cleanup()
183 share->lockfunc(NULL, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE, in curl_share_cleanup()
184 share->clientdata); in curl_share_cleanup()
186 if(share->dirty) { in curl_share_cleanup()
187 if(share->unlockfunc) in curl_share_cleanup()
188 share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata); in curl_share_cleanup()
192 Curl_hash_destroy(&share->hostcache); in curl_share_cleanup()
195 Curl_cookie_cleanup(share->cookies); in curl_share_cleanup()
199 if(share->sslsession) { in curl_share_cleanup()
201 for(i = 0; i < share->max_ssl_sessions; i++) in curl_share_cleanup()
202 Curl_ssl_kill_session(&(share->sslsession[i])); in curl_share_cleanup()
203 free(share->sslsession); in curl_share_cleanup()
207 if(share->unlockfunc) in curl_share_cleanup()
208 share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata); in curl_share_cleanup()
209 free(share); in curl_share_cleanup()
219 struct Curl_share *share = data->share; in Curl_share_lock() local
221 if(share == NULL) in Curl_share_lock()
224 if(share->specifier & (1<<type)) { in Curl_share_lock()
225 if(share->lockfunc) /* only call this if set! */ in Curl_share_lock()
226 share->lockfunc(data, type, accesstype, share->clientdata); in Curl_share_lock()
236 struct Curl_share *share = data->share; in Curl_share_unlock() local
238 if(share == NULL) in Curl_share_unlock()
241 if(share->specifier & (1<<type)) { in Curl_share_unlock()
242 if(share->unlockfunc) /* only call this if set! */ in Curl_share_unlock()
243 share->unlockfunc (data, type, share->clientdata); in Curl_share_unlock()