--- a/dav/webdav.c Wed Aug 14 18:01:37 2013 +0200 +++ b/dav/webdav.c Thu Aug 15 11:23:25 2013 +0200 @@ -481,7 +481,6 @@ curl_easy_setopt(handle, CURLOPT_WRITEDATA, stream); CURLcode ret = curl_easy_perform(handle); - int status = 0; curl_easy_getinfo (handle, CURLINFO_RESPONSE_CODE, &status); if(ret == CURLE_OK && (status >= 200 && status < 300)) { @@ -493,3 +492,25 @@ } } +int dav_delete(DavResource *res) { + char *url = util_concat_path(res->session->base_url, res->path); + CURL *handle = res->session->handle; + curl_easy_setopt(handle, CURLOPT_URL, url); + free(url); + + UcxBuffer *response = ucx_buffer_new(NULL, 4096, UCX_BUFFER_AUTOEXTEND); + CURLcode ret = do_delete_request(handle, response); + int status = 0; + curl_easy_getinfo (handle, CURLINFO_RESPONSE_CODE, &status); + if(ret == CURLE_OK && (status >= 200 && status < 300)) { + res->session->error = DAV_OK; + + // TODO: parse response + // TODO: free res + + return 0; + } else { + session_set_error(res->session, ret, status); + return 1; + } +}