# HG changeset patch # User Olaf Wintermann # Date 1546961833 -3600 # Node ID a23fedac340c555e970fb3229cfe5f4768e1d389 # Parent 868da3f76267cd2b5fa8ba09f0a3a5391d156ffa fixes DavSession creation in dav-sync when using root collection diff -r 868da3f76267 -r a23fedac340c dav/sync.c --- a/dav/sync.c Sun Dec 09 18:32:14 2018 +0100 +++ b/dav/sync.c Tue Jan 08 16:37:13 2019 +0100 @@ -330,6 +330,12 @@ url = util_concat_path(repo->url, collection); find_collection = FALSE; } + if(!collection || (collection[0] == '/' && strlen(collection) == 1)) { + // collection is NULL or "/" + // we don't need to find any collection because the repo url is + // the base url + find_collection = FALSE; + } DavSession *sn = dav_session_new_auth( ctx, url, @@ -519,6 +525,11 @@ int sync_delete = 0; int sync_error = 0; + UcxList *ls_get = NULL; + UcxList *ls_remove = NULL; + UcxList *ls_conflict = NULL; + UcxList *ls_broken = NULL; + UcxMap *svrres = ucx_map_new(db->resources->count); UcxList *statls = NULL; @@ -560,6 +571,7 @@ if(status && !strcmp(status, "broken")) { res = res->next; localres_keep(db, res->path); + ls_broken = ucx_list_append(ls_broken, res); continue; } @@ -667,6 +679,31 @@ return ret; } +int sync_remote_is_changed( + CmdArgs *a, + SyncDirectory *dir, + DavResource *res, + SyncDatabase *db, + DavBool force, + DavBool *conflict, + DavBool *metadataupdate) +{ + int cdt = cmd_getoption(a, "conflict") ? 0 : 1; // conflict detection + *conflict = 0; + *metadataupdate = 0; + + LocalResource *local = ucx_map_cstr_get(db->resources, res->path); + char *local_path = util_concat_path(dir->path, res->path); + + char *etag = dav_get_string_property(res, "D:getetag"); + SYS_STAT s; + int ret = 0; + + + free(local_path); + return ret; +} + int sync_get_resource( CmdArgs *a, SyncDirectory *dir,