dav/sync.c

changeset 560
a816e805e5db
parent 559
ba54fc8abdf1
child 561
5e6df4f502d3
equal deleted inserted replaced
559:ba54fc8abdf1 560:a816e805e5db
865 } 865 }
866 } else if(local) { 866 } else if(local) {
867 DavBool nochange = FALSE; 867 DavBool nochange = FALSE;
868 char *content_hash = sync_get_content_hash(res); 868 char *content_hash = sync_get_content_hash(res);
869 869
870 if(content_hash || local->hash) { 870 if(content_hash && local->hash) {
871 if(!nullstrcmp(content_hash, local->hash)) { 871 if(!strcmp(content_hash, local->hash)) {
872 nochange = TRUE; 872 nochange = TRUE;
873 } 873 }
874 } else if(local->etag) { 874 } else if(local->etag) {
875 sstr_t e = sstr(etag); 875 sstr_t e = sstr(etag);
876 if(sstrprefix(e, S("W/"))) { 876 if(sstrprefix(e, S("W/"))) {
1139 } else { 1139 } else {
1140 ret = dav_get_content(res, out, (dav_write_func)fwrite); 1140 ret = dav_get_content(res, out, (dav_write_func)fwrite);
1141 } 1141 }
1142 fclose(out); 1142 fclose(out);
1143 1143
1144 if(issplit) { 1144 if(issplit || dir->hashing) {
1145 if(truncate_file >= 0) { 1145 if(truncate_file >= 0) {
1146 // only true if issplit is true
1146 if(truncate(local_path, truncate_file)) { 1147 if(truncate(local_path, truncate_file)) {
1147 perror("truncate"); 1148 perror("truncate");
1148 } 1149 }
1149 } 1150 }
1150 1151
1323 local_path, 1324 local_path,
1324 new_path.ptr); 1325 new_path.ptr);
1325 } else { 1326 } else {
1326 LocalResource *conflict = calloc(1, sizeof(LocalResource)); 1327 LocalResource *conflict = calloc(1, sizeof(LocalResource));
1327 conflict->path = strdup(new_res_path.ptr); 1328 conflict->path = strdup(new_res_path.ptr);
1329 conflict->conflict_source = strdup(path);
1328 ucx_map_cstr_put(db->conflict, new_res_path.ptr, conflict); 1330 ucx_map_cstr_put(db->conflict, new_res_path.ptr, conflict);
1329 } 1331 }
1330 } 1332 }
1331 } 1333 }
1332 rev++; 1334 rev++;

mercurial