parent
bc26040897
commit
fca498570e
|
@ -231,6 +231,11 @@ string WebDAV::propfind(const string &pathUrl)
|
||||||
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PROPFIND");
|
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PROPFIND");
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, Util::writeCallback);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, Util::writeCallback);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
|
||||||
|
|
||||||
|
if (iv_access(CACERT_PATH.c_str(), R_OK) == 0)
|
||||||
|
curl_easy_setopt(curl, CURLOPT_CAINFO, CACERT_PATH.c_str());
|
||||||
|
|
||||||
|
//TODO add sorter here
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "<\?xml version=\"1.0\" encoding=\"UTF-8\"\?> \
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "<\?xml version=\"1.0\" encoding=\"UTF-8\"\?> \
|
||||||
<d:propfind xmlns:d=\"DAV:\"><d:prop xmlns:oc=\"http://owncloud.org/ns\"> \
|
<d:propfind xmlns:d=\"DAV:\"><d:prop xmlns:oc=\"http://owncloud.org/ns\"> \
|
||||||
<d:getlastmodified/> \
|
<d:getlastmodified/> \
|
||||||
|
@ -310,6 +315,8 @@ bool WebDAV::get(WebDAVItem &item)
|
||||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, false);
|
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, false);
|
||||||
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, Util::progress_callback);
|
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, Util::progress_callback);
|
||||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||||
|
if (iv_access(CACERT_PATH.c_str(), R_OK) == 0)
|
||||||
|
curl_easy_setopt(curl, CURLOPT_CAINFO, CACERT_PATH.c_str());
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
iv_fclose(fp);
|
iv_fclose(fp);
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
|
|
||||||
const std::string NEXTCLOUD_ROOT_PATH = "/remote.php/dav/files/";
|
const std::string NEXTCLOUD_ROOT_PATH = "/remote.php/dav/files/";
|
||||||
const std::string NEXTCLOUD_START_PATH = "/remote.php/";
|
const std::string NEXTCLOUD_START_PATH = "/remote.php/";
|
||||||
const std::string CACERT_PATH = "/mnt/ext1/applications/cacert.pem";
|
|
||||||
const std::string NEXTCLOUD_PATH = "/mnt/ext1/system/config/nextcloud";
|
const std::string NEXTCLOUD_PATH = "/mnt/ext1/system/config/nextcloud";
|
||||||
|
const std::string CACERT_PATH = NEXTCLOUD_PATH + "/customCert.pem";
|
||||||
|
|
||||||
class WebDAV
|
class WebDAV
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue