Lines Matching refs:share
27 #include "share.h"
37 struct Curl_share *share = calloc(1, sizeof(struct Curl_share));
38 if(share) {
39 share->specifier |= (1<<CURL_LOCK_DATA_SHARE);
41 if(Curl_mk_dnscache(&share->hostcache)) {
42 free(share);
47 return share;
54 struct Curl_share *share = (struct Curl_share *)sh;
62 if(share->dirty)
64 using this share */
71 /* this is a type this share will share */
73 share->specifier |= (1<<type);
80 if(!share->cookies) {
81 share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE );
82 if(!share->cookies)
92 if(!share->sslsession) {
93 share->max_ssl_sessions = 8;
94 share->sslsession = calloc(share->max_ssl_sessions,
96 share->sessionage = 0;
97 if(!share->sslsession)
114 /* this is a type this share will no longer share */
116 share->specifier &= ~(1<<type);
123 if(share->cookies) {
124 Curl_cookie_cleanup(share->cookies);
125 share->cookies = NULL;
134 Curl_safefree(share->sslsession);
151 share->lockfunc = lockfunc;
156 share->unlockfunc = unlockfunc;
161 share->clientdata = ptr;
177 struct Curl_share *share = (struct Curl_share *)sh;
179 if(share == NULL)
182 if(share->lockfunc)
183 share->lockfunc(NULL, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE,
184 share->clientdata);
186 if(share->dirty) {
187 if(share->unlockfunc)
188 share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata);
192 Curl_hash_destroy(&share->hostcache);
195 Curl_cookie_cleanup(share->cookies);
199 if(share->sslsession) {
201 for(i = 0; i < share->max_ssl_sessions; i++)
202 Curl_ssl_kill_session(&(share->sslsession[i]));
203 free(share->sslsession);
207 if(share->unlockfunc)
208 share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata);
209 free(share);
219 struct Curl_share *share = data->share;
221 if(share == NULL)
224 if(share->specifier & (1<<type)) {
225 if(share->lockfunc) /* only call this if set! */
226 share->lockfunc(data, type, accesstype, share->clientdata);
228 /* else if we don't share this, pretend successful lock */
236 struct Curl_share *share = data->share;
238 if(share == NULL)
241 if(share->specifier & (1<<type)) {
242 if(share->unlockfunc) /* only call this if set! */
243 share->unlockfunc (data, type, share->clientdata);