dav/sync.c

changeset 810
baf199df500e
parent 799
d479b5e25b6e
child 812
5fe4453fc025
equal deleted inserted replaced
809:8e6d8f0327cf 810:baf199df500e
838 cxListInsert(stack, 0, ls->children); 838 cxListInsert(stack, 0, ls->children);
839 while(stack->size > 0) { 839 while(stack->size > 0) {
840 DavResource *res = cxListAt(stack, 0); 840 DavResource *res = cxListAt(stack, 0);
841 cxListRemove(stack, 0); 841 cxListRemove(stack, 0);
842 842
843 while(res) { 843 while(res) {
844 DavBool res_filtered = FALSE; 844 DavBool res_filtered = FALSE;
845 if (res_matches_dir_filter(dir, res->path)) { 845 if (res_matches_dir_filter(dir, res->path)) {
846 res_filtered = TRUE; 846 res_filtered = TRUE;
847 } else { 847 } else {
848 CxIterator iter = cxListIterator(dir->filter.tags); 848 CxIterator iter = cxListIterator(dir->filter.tags);
1082 } 1082 }
1083 } 1083 }
1084 1084
1085 CxList *rmdirs = cxLinkedListCreate(cxDefaultAllocator, (cx_compare_func)resource_pathlen_cmp, CX_STORE_POINTERS); 1085 CxList *rmdirs = cxLinkedListCreate(cxDefaultAllocator, (cx_compare_func)resource_pathlen_cmp, CX_STORE_POINTERS);
1086 i = cxMapIteratorValues(lres_removed); 1086 i = cxMapIteratorValues(lres_removed);
1087 LocalResource *removed_res;
1088 cx_foreach(LocalResource *, removed_res, i) { 1087 cx_foreach(LocalResource *, removed_res, i) {
1089 if(sync_shutdown) { 1088 if(sync_shutdown) {
1090 break; 1089 break;
1091 } 1090 }
1092 1091
2182 continue; 2181 continue;
2183 } 2182 }
2184 } 2183 }
2185 } 2184 }
2186 2185
2187 2186
2188 // we need a fast file lookup map later to detect deleted files 2187 // we need a fast file lookup map later to detect deleted files
2189 cxMapPut(resources_map, cx_hash_key_str(local_res->path), local_res); 2188 cxMapPut(resources_map, cx_hash_key_str(local_res->path), local_res);
2190 2189
2191 // dynamic tag filter 2190 // dynamic tag filter
2192 if(!localres_matches_tags(dir, local_res, tagfilter)) { 2191 if(!localres_matches_tags(dir, local_res, tagfilter)) {
3073 LocalResource *res = calloc(1, sizeof(LocalResource)); 3072 LocalResource *res = calloc(1, sizeof(LocalResource));
3074 res->mode = s.st_mode & 07777; 3073 res->mode = s.st_mode & 07777;
3075 res->uid = s.st_uid; 3074 res->uid = s.st_uid;
3076 res->gid = s.st_gid; 3075 res->gid = s.st_gid;
3077 res->last_modified = s.st_mtime; 3076 res->last_modified = s.st_mtime;
3077 res->path = strdup(path);
3078 if(!S_ISDIR(s.st_mode)) { 3078 if(!S_ISDIR(s.st_mode)) {
3079 res->path = strdup(path); 3079 //res->path = strdup(path);
3080 res->size = s.st_size; 3080 res->size = s.st_size;
3081 } else { 3081 } else {
3082 res->path = util_concat_path(path, "/"); 3082 //res->path = util_concat_path(path, "/");
3083 res->isdirectory = 1; 3083 res->isdirectory = 1;
3084 } 3084 }
3085 3085
3086 int skip_file = 0; 3086 int skip_file = 0;
3087 if(SYS_ISLINK(file_path, s)) { 3087 if(SYS_ISLINK(file_path, s)) {

mercurial