899 } |
899 } |
900 |
900 |
901 /* ----------------------------- PUT ----------------------------- */ |
901 /* ----------------------------- PUT ----------------------------- */ |
902 |
902 |
903 static size_t dummy_write(void *buf, size_t s, size_t n, void *data) { |
903 static size_t dummy_write(void *buf, size_t s, size_t n, void *data) { |
|
904 //fwrite(buf, s, n, stdout); |
904 return s*n; |
905 return s*n; |
905 } |
906 } |
906 |
907 |
907 CURLcode do_put_request(CURL *handle, char *lock, DavBool create, void *data, dav_read_func read_func, size_t length) { |
908 CURLcode do_put_request(CURL *handle, char *lock, DavBool create, void *data, dav_read_func read_func, size_t length) { |
908 curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, NULL); |
909 curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, NULL); |
989 url = util_parent_path(url); |
990 url = util_parent_path(url); |
990 char *ltheader = ucx_sprintf("If: <%s> (<%s>)", url, lock).ptr; |
991 char *ltheader = ucx_sprintf("If: <%s> (<%s>)", url, lock).ptr; |
991 free(url); |
992 free(url); |
992 headers = curl_slist_append(headers, ltheader); |
993 headers = curl_slist_append(headers, ltheader); |
993 free(ltheader); |
994 free(ltheader); |
994 curl_easy_setopt(handle, CURLOPT_HTTPHEADER, NULL); |
995 curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); |
995 } else { |
996 } else { |
996 curl_easy_setopt(handle, CURLOPT_HTTPHEADER, NULL); |
997 curl_easy_setopt(handle, CURLOPT_HTTPHEADER, NULL); |
997 } |
998 } |
998 |
999 |
999 curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, "MKCOL"); |
1000 curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, "MKCOL"); |