dav/sync.c

changeset 68
f6d3db6113d3
parent 66
f8c1f685e08e
child 72
aac29f2e8030
--- a/dav/sync.c	Fri Dec 12 13:57:41 2014 +0100
+++ b/dav/sync.c	Fri Dec 12 15:19:38 2014 +0100
@@ -161,6 +161,7 @@
     if(dir->collection) {
         new_url = util_concat_path(repo->url, dir->collection);
     }
+    // TODO: session creator function
     DavSession *sn = dav_session_new_auth(
             ctx,
             new_url ? new_url : repo->url,
@@ -169,8 +170,12 @@
     if(new_url) {
         free(new_url);
     }
-    dav_session_set_flags(sn, get_repository_flags(repo));
+    sn->flags = get_repository_flags(repo);
     sn->key = dav_context_get_key(ctx, repo->default_key);
+    if (cmd_getoption(a, "verbose")) {
+        curl_easy_setopt(sn->handle, CURLOPT_VERBOSE, 1L);
+        curl_easy_setopt(sn->handle, CURLOPT_STDERR, stderr);
+    }
     
     DavResource *ls = dav_query(sn, "get D:getetag from / where lastmodified > 0 with depth -1");
     if(!ls) {
@@ -460,6 +465,7 @@
     if(dir->collection) {
         new_url = util_concat_path(repo->url, dir->collection);
     }
+    // TODO: session creator function
     DavSession *sn = dav_session_new_auth(
             ctx,
             new_url ? new_url : repo->url,
@@ -468,8 +474,12 @@
     if(new_url) {
         free(new_url);
     }
-    dav_session_set_flags(sn, get_repository_flags(repo));
+    sn->flags = get_repository_flags(repo);
     sn->key = dav_context_get_key(ctx, repo->default_key);
+    if (cmd_getoption(a, "verbose")) {
+        curl_easy_setopt(sn->handle, CURLOPT_VERBOSE, 1L);
+        curl_easy_setopt(sn->handle, CURLOPT_STDERR, stderr);
+    }
     
     // upload all changed files
     UcxList *resources = cmd_getoption(a, "read") ?

mercurial