dav/sync.c

changeset 547
4a249c645ae4
parent 546
33e312dd851d
child 548
ab46acda1066
equal deleted inserted replaced
546:33e312dd851d 547:4a249c645ae4
1166 free(local_path); 1166 free(local_path);
1167 return -1; 1167 return -1;
1168 } 1168 }
1169 } 1169 }
1170 1170
1171 if(sys_stat(local_path, &s)) {
1172 fprintf(stderr,
1173 "Cannot stat file %s: %s\n", local_path, strerror(errno));
1174 }
1175
1176 if(!local) { 1171 if(!local) {
1177 // new local resource 1172 // new local resource
1178 local = calloc(1, sizeof(LocalResource)); 1173 local = calloc(1, sizeof(LocalResource));
1179 local->path = strdup(path); 1174 local->path = strdup(path);
1180 ucx_map_cstr_put(db->resources, local->path, local); 1175 ucx_map_cstr_put(db->resources, local->path, local);
1190 if(local->hash) { 1185 if(local->hash) {
1191 free(local->hash); 1186 free(local->hash);
1192 } 1187 }
1193 1188
1194 update_parts(local, part_updates, blockcount); 1189 update_parts(local, part_updates, blockcount);
1190
1191 if(sys_stat(local_path, &s)) {
1192 fprintf(stderr,
1193 "Cannot stat file %s: %s\n", local_path, strerror(errno));
1194 }
1195 1195
1196 // set metadata from stat 1196 // set metadata from stat
1197 local->etag = strdup(etag); 1197 local->etag = strdup(etag);
1198 if(content_hash) { 1198 if(content_hash) {
1199 local->hash = content_hash; 1199 local->hash = content_hash;

mercurial