X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/f900f5fe712f9028aae486b95dcd5648d6aa44dc..e1b3d5c4be46ee0b17a98aa48cb7cb152c4a008b:/match.c diff --git a/match.c b/match.c index 12102158..272025aa 100644 --- a/match.c +++ b/match.c @@ -29,18 +29,18 @@ extern int remote_version; typedef unsigned short tag; #define TABLESIZE (1<<16) -#define NULL_TAG ((tag)-1) +#define NULL_TAG (-1) static int false_alarms; static int tag_hits; static int matches; -static int data_transfer; +static int64 data_transfer; static int total_false_alarms; static int total_tag_hits; static int total_matches; -static int64 total_data_transfer; +extern struct stats stats; struct target { tag t; @@ -49,7 +49,7 @@ struct target { static struct target *targets; -static tag *tag_table; +static int *tag_table; #define gettag2(s1,s2) (((s1) + (s2)) & 0xFFFF) #define gettag(sum) gettag2((sum)&0xFFFF,(sum)>>16) @@ -65,7 +65,7 @@ static void build_hash_table(struct sum_struct *s) int i; if (!tag_table) - tag_table = (tag *)malloc(sizeof(tag)*TABLESIZE); + tag_table = (int *)malloc(sizeof(tag_table[0])*TABLESIZE); targets = (struct target *)malloc(sizeof(targets[0])*s->count); if (!tag_table || !targets) @@ -103,11 +103,10 @@ static void matched(int f,struct sum_struct *s,struct map_struct *buf, send_token(f,i,buf,last_match,n,i<0?0:s->sums[i].len); data_transfer += n; - if (n > 0) - write_flush(f); - - if (i >= 0) + if (i >= 0) { + stats.matched_data += s->sums[i].len; n += s->sums[i].len; + } for (j=0;j