dav/methods.c

changeset 16
5dbef9e07376
parent 15
182af08b4813
child 17
11dffb40cd91
equal deleted inserted replaced
15:182af08b4813 16:5dbef9e07376
451 curl_easy_setopt(handle, CURLOPT_READDATA, data); 451 curl_easy_setopt(handle, CURLOPT_READDATA, data);
452 452
453 curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, dummy_write); 453 curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, dummy_write);
454 curl_easy_setopt(handle, CURLOPT_WRITEDATA, NULL); 454 curl_easy_setopt(handle, CURLOPT_WRITEDATA, NULL);
455 455
456 CURLcode res = curl_easy_perform(handle); 456 CURLcode ret = curl_easy_perform(handle);
457 if(buf) { 457 if(buf) {
458 ucx_buffer_free(buf); 458 ucx_buffer_free(buf);
459 } 459 }
460 return res; 460 return ret;
461 } 461 }
462 462
463 CURLcode do_delete_request(CURL *handle, UcxBuffer *response) { 463 CURLcode do_delete_request(CURL *handle, UcxBuffer *response) {
464 curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, "DELETE"); 464 curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, "DELETE");
465 curl_easy_setopt(handle, CURLOPT_PUT, 0L); 465 curl_easy_setopt(handle, CURLOPT_PUT, 0L);
467 curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0); 467 curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0);
468 468
469 curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, ucx_buffer_write); 469 curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, ucx_buffer_write);
470 curl_easy_setopt(handle, CURLOPT_WRITEDATA, response); 470 curl_easy_setopt(handle, CURLOPT_WRITEDATA, response);
471 471
472 CURLcode res = curl_easy_perform(handle); 472 CURLcode ret = curl_easy_perform(handle);
473 return res; 473 return ret;
474 } 474 }
475
476 CURLcode do_mkcol_request(CURL *handle) {
477 curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, "MKCOL");
478 curl_easy_setopt(handle, CURLOPT_PUT, 0L);
479 curl_easy_setopt(handle, CURLOPT_UPLOAD, 0L);
480 curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0);
481
482 curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, dummy_write);
483 curl_easy_setopt(handle, CURLOPT_WRITEDATA, NULL);
484
485 CURLcode ret = curl_easy_perform(handle);
486 return ret;
487 }

mercurial