+ for (ent = flp->head; ent; ent = ent->next) {
+ unsigned int len, plen, dlen;
+ char *p;
+
+ if (ent->match_flags & MATCHFLG_CVS_IGNORE
+ && !(ent->match_flags & MATCHFLG_MERGE_FILE)) {
+ if (am_sender || protocol_version < 29) {
+ send_rules(f_out, &cvs_filter_list);
+ continue;
+ }
+ }
+ p = get_rule_prefix(ent->match_flags, ent->pattern, 1, &plen);
+ if (!p) {
+ rprintf(FERROR,
+ "filter rules are too modern for remote rsync.\n");
+ exit_cleanup(RERR_SYNTAX);
+ }
+ len = strlen(ent->pattern);
+ dlen = ent->match_flags & MATCHFLG_DIRECTORY ? 1 : 0;
+ if (!(plen + len + dlen))
+ continue;
+ write_int(f_out, plen + len + dlen);
+ if (plen)
+ write_buf(f_out, p, plen);
+ write_buf(f_out, ent->pattern, len);
+ if (dlen)
+ write_byte(f_out, '/');
+ }
+}
+
+/* This is only called by the client. */
+void send_filter_list(int f_out)
+{
+ if (am_sender && (!delete_mode || delete_excluded))
+ f_out = -1;
+ if (cvs_exclude && am_sender) {
+ if (protocol_version >= 29)
+ parse_rule(&filter_list, ":C", 0, 0);
+ parse_rule(&filter_list, "-C", 0, 0);
+ }
+