# HG changeset patch # User Mike Becker # Date 1444928689 -7200 # Node ID 747f3796eddd63f89d8364009d203573de693a60 # Parent 9e14d920a7d0c4fad633da5007be3ca02318eb25 improved util_capture_header when deactivating the capturing diff -r 9e14d920a7d0 -r 747f3796eddd libidav/methods.c --- a/libidav/methods.c Thu Oct 15 17:45:00 2015 +0200 +++ b/libidav/methods.c Thu Oct 15 19:04:49 2015 +0200 @@ -103,12 +103,11 @@ } } + // deactivate header capturing and free captured map + util_capture_header(handle, NULL); ucx_map_free_content(respheaders, free); ucx_map_free(respheaders); - curl_easy_setopt(handle, CURLOPT_HEADERFUNCTION, NULL); - curl_easy_setopt(handle, CURLOPT_HEADERDATA, NULL); - return ret; } diff -r 9e14d920a7d0 -r 747f3796eddd libidav/utils.c --- a/libidav/utils.c Thu Oct 15 17:45:00 2015 +0200 +++ b/libidav/utils.c Thu Oct 15 19:04:49 2015 +0200 @@ -323,14 +323,13 @@ } void util_capture_header(CURL *handle, UcxMap* map) { - if(!map) { - // deactivate capturing + if(map) { + curl_easy_setopt(handle, CURLOPT_HEADERFUNCTION, util_header_callback); + curl_easy_setopt(handle, CURLOPT_HEADERDATA, map); + } else { curl_easy_setopt(handle, CURLOPT_HEADERFUNCTION, NULL); - return; + curl_easy_setopt(handle, CURLOPT_HEADERDATA, NULL); } - - curl_easy_setopt(handle, CURLOPT_HEADERFUNCTION, util_header_callback); - curl_easy_setopt(handle, CURLOPT_HEADERDATA, map); } char* util_resource_name(char *url) {