135 UcxList *exclude = NULL; |
135 UcxList *exclude = NULL; |
136 int max_retry = 0; |
136 int max_retry = 0; |
137 bool backuppull = false; |
137 bool backuppull = false; |
138 bool lockpull = false; |
138 bool lockpull = false; |
139 bool lockpush = false; |
139 bool lockpush = false; |
|
140 time_t lock_timeout = 0; |
140 |
141 |
141 unsigned short parentlineno = node->line; |
142 unsigned short parentlineno = node->line; |
142 node = node->children; |
143 node = node->children; |
143 while(node) { |
144 while(node) { |
144 if(node->type == XML_ELEMENT_NODE) { |
145 if(node->type == XML_ELEMENT_NODE) { |
181 backuppull = util_getboolean(value); |
182 backuppull = util_getboolean(value); |
182 } else if(xstreq(node->name, "lock-pull")) { |
183 } else if(xstreq(node->name, "lock-pull")) { |
183 lockpull = util_getboolean(value); |
184 lockpull = util_getboolean(value); |
184 } else if(xstreq(node->name, "lock-push")) { |
185 } else if(xstreq(node->name, "lock-push")) { |
185 lockpush = util_getboolean(value); |
186 lockpush = util_getboolean(value); |
|
187 } else if(xstreq(node->name, "lock-timeout")) { |
|
188 int64_t t = 0; |
|
189 if(util_strtoint(value, &t)) { |
|
190 lock_timeout = (time_t)t; |
|
191 } else { |
|
192 print_warning(node->line, "integer value " |
|
193 "expected in <lock-timeout> element\n"); |
|
194 } |
186 } else { |
195 } else { |
187 print_error(node->line, |
196 print_error(node->line, |
188 "unknown directory config element: %s\n", node->name); |
197 "unknown directory config element: %s\n", node->name); |
189 return 1; |
198 return 1; |
190 } |
199 } |
220 dir->database = strdup(database); |
229 dir->database = strdup(database); |
221 dir->max_retry = max_retry; |
230 dir->max_retry = max_retry; |
222 dir->backuppull = backuppull; |
231 dir->backuppull = backuppull; |
223 dir->lockpull = lockpull; |
232 dir->lockpull = lockpull; |
224 dir->lockpush = lockpush; |
233 dir->lockpush = lockpush; |
|
234 dir->lock_timeout = lock_timeout; |
225 if (include) { |
235 if (include) { |
226 dir->include = include; |
236 dir->include = include; |
227 } else { |
237 } else { |
228 regex_t *matchall = malloc(sizeof(regex_t)); |
238 regex_t *matchall = malloc(sizeof(regex_t)); |
229 regcomp(matchall, ".*", REG_NOSUB); |
239 regcomp(matchall, ".*", REG_NOSUB); |