diff options
author | Matt McCutchen <matt@mattmccutchen.net> | 2009-05-23 10:59:14 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2009-05-23 11:20:40 -0700 |
commit | c8fa85b23bfebc68f0ab2e0464937f5ee4a8bf69 (patch) | |
tree | ae6861995306bbd3fd94584e7555f38b73b4fcb5 /clientserver.c | |
parent | a61ec6b1688ea64fba7c03d69d6f75a7e0b24c61 (diff) | |
download | android_external_rsync-c8fa85b23bfebc68f0ab2e0464937f5ee4a8bf69.tar.gz android_external_rsync-c8fa85b23bfebc68f0ab2e0464937f5ee4a8bf69.tar.bz2 android_external_rsync-c8fa85b23bfebc68f0ab2e0464937f5ee4a8bf69.zip |
Refactorings to the filter code, most notably:
- Improve function name: parse_rule -> parse_filter_str (to make the
similarity with parse_filter_file clearer, and better indicate that
it can parse multiple rules when FILTRULE_WORD_SPLIT is specified).
- In preparation for rule prefixes containing information beyond the
rflags, change the code to pass around a full "template" filter_rule
instead of just rflags. Callers of parse_filter_{str,file} that want
to specify only rflags can use rule_template(rflags) .
- Remove the MODIFIERS_* strings and instead hand-code the condition
under which each modifier is valid. This should make it easier to
see that the conditions are correct.
- Tighten up default modifiers on merge rules:
- Disallow "!" because it isn't useful.
- If the merge rule specifies a side via "s" or "r", the rules in the
file cannot also specify a side via "s", "r", "hide", etc.
[Patch was changed by Wayne a bit prior to application.]
Diffstat (limited to 'clientserver.c')
-rw-r--r-- | clientserver.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clientserver.c b/clientserver.c index b16e0fc6..88f341e8 100644 --- a/clientserver.c +++ b/clientserver.c @@ -620,24 +620,24 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char set_filter_dir(module_dir, module_dirlen); p = lp_filter(i); - parse_rule(&daemon_filter_list, p, FILTRULE_WORD_SPLIT, + parse_filter_str(&daemon_filter_list, p, rule_template(FILTRULE_WORD_SPLIT), XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3); p = lp_include_from(i); - parse_filter_file(&daemon_filter_list, p, FILTRULE_INCLUDE, + parse_filter_file(&daemon_filter_list, p, rule_template(FILTRULE_INCLUDE), XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES | XFLG_FATAL_ERRORS); p = lp_include(i); - parse_rule(&daemon_filter_list, p, - FILTRULE_INCLUDE | FILTRULE_WORD_SPLIT, + parse_filter_str(&daemon_filter_list, p, + rule_template(FILTRULE_INCLUDE | FILTRULE_WORD_SPLIT), XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES); p = lp_exclude_from(i); - parse_filter_file(&daemon_filter_list, p, 0, + parse_filter_file(&daemon_filter_list, p, rule_template(0), XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES | XFLG_FATAL_ERRORS); p = lp_exclude(i); - parse_rule(&daemon_filter_list, p, FILTRULE_WORD_SPLIT, + parse_filter_str(&daemon_filter_list, p, rule_template(FILTRULE_WORD_SPLIT), XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES); log_init(1); |