47 if(url.length == 0) { |
47 if(url.length == 0) { |
48 return NULL; |
48 return NULL; |
49 } |
49 } |
50 DavSession *sn = malloc(sizeof(DavSession)); |
50 DavSession *sn = malloc(sizeof(DavSession)); |
51 memset(sn, 0, sizeof(DavSession)); |
51 memset(sn, 0, sizeof(DavSession)); |
52 sn->mp = cxBasicMempoolCreate(DAV_SESSION_MEMPOOL_SIZE); |
52 sn->mp = cxMempoolCreateSimple(DAV_SESSION_MEMPOOL_SIZE); |
53 sn->pathcache = cxHashMapCreate(sn->mp->allocator, CX_STORE_POINTERS, DAV_PATH_CACHE_SIZE); |
53 sn->pathcache = cxHashMapCreate(sn->mp->allocator, CX_STORE_POINTERS, DAV_PATH_CACHE_SIZE); |
54 sn->key = NULL; |
54 sn->key = NULL; |
55 sn->errorstr = NULL; |
55 sn->errorstr = NULL; |
56 sn->error = DAV_OK; |
56 sn->error = DAV_OK; |
57 sn->flags = 0; |
57 sn->flags = 0; |
116 DavSession* dav_session_clone(DavSession *sn) { |
116 DavSession* dav_session_clone(DavSession *sn) { |
117 CURL *newhandle = curl_easy_duphandle(sn->handle); |
117 CURL *newhandle = curl_easy_duphandle(sn->handle); |
118 |
118 |
119 DavSession *newsn = malloc(sizeof(DavSession)); |
119 DavSession *newsn = malloc(sizeof(DavSession)); |
120 memset(newsn, 0, sizeof(DavSession)); |
120 memset(newsn, 0, sizeof(DavSession)); |
121 newsn->mp = cxBasicMempoolCreate(DAV_SESSION_MEMPOOL_SIZE); |
121 newsn->mp = cxMempoolCreateSimple(DAV_SESSION_MEMPOOL_SIZE); |
122 newsn->pathcache = cxHashMapCreate(newsn->mp->allocator, CX_STORE_POINTERS, DAV_PATH_CACHE_SIZE); |
122 newsn->pathcache = cxHashMapCreate(newsn->mp->allocator, CX_STORE_POINTERS, DAV_PATH_CACHE_SIZE); |
123 newsn->key = sn->key; |
123 newsn->key = sn->key; |
124 newsn->errorstr = NULL; |
124 newsn->errorstr = NULL; |
125 newsn->error = DAV_OK; |
125 newsn->error = DAV_OK; |
126 newsn->flags = 0; |
126 newsn->flags = 0; |