libidav/session.c

changeset 101
7b3a3130be44
parent 55
1ce14068ef31
equal deleted inserted replaced
100:d2bd73d28ff1 101:7b3a3130be44
209 if(ret == CURLE_OK) { 209 if(ret == CURLE_OK) {
210 if(sn->logfunc) { 210 if(sn->logfunc) {
211 char *log_method; 211 char *log_method;
212 char *log_url; 212 char *log_url;
213 curl_easy_getinfo(sn->handle, CURLINFO_EFFECTIVE_URL, &log_url); 213 curl_easy_getinfo(sn->handle, CURLINFO_EFFECTIVE_URL, &log_url);
214 #if LIBCURL_VERSION_NUM >= 0x074800
214 curl_easy_getinfo(sn->handle, CURLINFO_EFFECTIVE_METHOD , &log_method); 215 curl_easy_getinfo(sn->handle, CURLINFO_EFFECTIVE_METHOD , &log_method);
216 #else
217 long opt_upload = 0;
218 curl_easy_getinfo(sn->handle, CURLOPT_UPLOAD, &opt_upload);
219 char *opt_custom = NULL;
220 curl_easy_getinfo(sn->handle, CURLOPT_CUSTOMREQUEST, &opt_custom);
221 if(opt_custom) {
222 log_method = opt_custom;
223 } else if(opt_upload) {
224 log_method = "PUT";
225 } else {
226 log_method = "GET";
227 }
228 #endif
215 char *log_reqbody = NULL; 229 char *log_reqbody = NULL;
216 size_t log_reqbodylen = 0; 230 size_t log_reqbodylen = 0;
217 char *log_rpbody = NULL; 231 char *log_rpbody = NULL;
218 size_t log_rpbodylen = 0; 232 size_t log_rpbodylen = 0;
219 if(request) { 233 if(request) {
335 dav_session_destructor(sn); 349 dav_session_destructor(sn);
336 } 350 }
337 } 351 }
338 352
339 void dav_session_destructor(DavSession *sn) { 353 void dav_session_destructor(DavSession *sn) {
340 cxMempoolDestroy(sn->mp); 354 cxMempoolFree(sn->mp);
341 curl_easy_cleanup(sn->handle); 355 curl_easy_cleanup(sn->handle);
342 free(sn); 356 free(sn);
343 } 357 }
344 358
345 359
630 DavLockManager *locks = get_lock_manager(sn); 644 DavLockManager *locks = get_lock_manager(sn);
631 if(!locks) { 645 if(!locks) {
632 return; 646 return;
633 } 647 }
634 648
635 if(cxMapRemoveAndGet(locks->resource_locks, cx_hash_key_str(path))) { 649 if(!cxMapRemove(locks->resource_locks, cx_hash_key_str(path))) {
636 return; 650 return;
637 } 651 }
638 652
639 cxListFindRemove(locks->collection_locks, lock); 653 cxListFindRemove(locks->collection_locks, lock);
640 } 654 }

mercurial