903 static int dav_cp_mv_url(DavResource *res, char *desturl, _Bool copy, _Bool override) { |
903 static int dav_cp_mv_url(DavResource *res, char *desturl, _Bool copy, _Bool override) { |
904 DavSession *sn = res->session; |
904 DavSession *sn = res->session; |
905 CURL *handle = sn->handle; |
905 CURL *handle = sn->handle; |
906 util_set_url(sn, dav_resource_get_href(res)); |
906 util_set_url(sn, dav_resource_get_href(res)); |
907 |
907 |
908 CURLcode ret = do_copy_move_request(handle, desturl, copy, override); |
908 DavLock *lock = dav_get_lock(sn, res->path); |
|
909 char *locktoken = lock ? lock->token : NULL; |
|
910 |
|
911 CURLcode ret = do_copy_move_request(handle, desturl, locktoken, copy, override); |
909 |
912 |
910 long status = 0; |
913 long status = 0; |
911 curl_easy_getinfo (handle, CURLINFO_RESPONSE_CODE, &status); |
914 curl_easy_getinfo (handle, CURLINFO_RESPONSE_CODE, &status); |
912 if(ret == CURLE_OK && (status >= 200 && status < 300)) { |
915 if(ret == CURLE_OK && (status >= 200 && status < 300)) { |
913 return 0; |
916 return 0; |