127 char *database = NULL; |
127 char *database = NULL; |
128 UcxList *include = NULL; |
128 UcxList *include = NULL; |
129 UcxList *exclude = NULL; |
129 UcxList *exclude = NULL; |
130 int max_retry = DAV_MAX_RETRY; |
130 int max_retry = DAV_MAX_RETRY; |
131 bool backuppull = false; |
131 bool backuppull = false; |
|
132 bool lockpull = false; |
|
133 bool lockpush = true; |
132 |
134 |
133 node = node->children; |
135 node = node->children; |
134 while(node) { |
136 while(node) { |
135 if(node->type == XML_ELEMENT_NODE) { |
137 if(node->type == XML_ELEMENT_NODE) { |
136 char *value = util_xml_get_text(node); |
138 char *value = util_xml_get_text(node); |
160 fprintf(stderr, "Warnung: sync.xml: integer value " |
162 fprintf(stderr, "Warnung: sync.xml: integer value " |
161 "expected in <max-retry> element\n"); |
163 "expected in <max-retry> element\n"); |
162 } |
164 } |
163 } else if(xstreq(node->name, "backup-on-pull")) { |
165 } else if(xstreq(node->name, "backup-on-pull")) { |
164 backuppull = util_getboolean(value); |
166 backuppull = util_getboolean(value); |
|
167 } else if(xstreq(node->name, "lock-pull")) { |
|
168 lockpull = util_getboolean(value); |
|
169 } else if(xstreq(node->name, "lock-push")) { |
|
170 lockpush = util_getboolean(value); |
165 } |
171 } |
166 } |
172 } |
167 node = node->next; |
173 node = node->next; |
168 } |
174 } |
169 |
175 |
190 dir->collection = collection ? strdup(collection) : NULL; |
196 dir->collection = collection ? strdup(collection) : NULL; |
191 dir->repository = strdup(repository); |
197 dir->repository = strdup(repository); |
192 dir->database = strdup(database); |
198 dir->database = strdup(database); |
193 dir->max_retry = max_retry; |
199 dir->max_retry = max_retry; |
194 dir->backuppull = backuppull; |
200 dir->backuppull = backuppull; |
|
201 dir->lockpull = lockpull; |
|
202 dir->lockpush = lockpush; |
195 if (include) { |
203 if (include) { |
196 dir->include = include; |
204 dir->include = include; |
197 } else { |
205 } else { |
198 regex_t *matchall = malloc(sizeof(regex_t)); |
206 regex_t *matchall = malloc(sizeof(regex_t)); |
199 regcomp(matchall, ".*", REG_NOSUB); |
207 regcomp(matchall, ".*", REG_NOSUB); |