if ((int64)sum->count != l)
sum->count = -1;
- if (sum->count && DEBUG_GTE(CHKSUM, 2)) {
+ if (sum->count && DEBUG_GTE(DELTASUM, 2)) {
rprintf(FINFO,
"count=%s rem=%ld blength=%ld s2length=%d flength=%s\n",
big_num(sum->count, 0), (long)sum->remainder, (long)sum->blength,
sum1 = get_checksum1(map, n1);
get_checksum2(map, n1, sum2);
- if (DEBUG_GTE(CHKSUM, 3)) {
+ if (DEBUG_GTE(DELTASUM, 3)) {
rprintf(FINFO,
"chunk[%s] offset=%s len=%ld sum1=%08lx\n",
big_num(i, 0), big_num(offset - n1, 0), (long)n1,
fnamecmp_type = FNAMECMP_BACKUP;
}
- if (DEBUG_GTE(CHKSUM, 3)) {
+ if (DEBUG_GTE(DELTASUM, 3)) {
rprintf(FINFO, "gen mapped %s of size %s\n",
fnamecmp, big_num(sx.st.st_size, 0));
}
- if (DEBUG_GTE(CHKSUM, 2))
+ if (DEBUG_GTE(DELTASUM, 2))
rprintf(FINFO, "generating and sending sums for %d\n", ndx);
notify_others:
int32 n = (int32)(offset - last_match); /* max value: block_size (int32) */
int32 j;
- if (DEBUG_GTE(CHKSUM, 2) && i >= 0) {
+ if (DEBUG_GTE(DELTASUM, 2) && i >= 0) {
rprintf(FINFO,
"match at %s last_match=%s j=%d len=%ld n=%ld\n",
big_num(offset, 0), big_num(last_match, 0), i,
* coding of the output to work more efficiently. */
want_i = 0;
- if (DEBUG_GTE(CHKSUM, 2)) {
+ if (DEBUG_GTE(DELTASUM, 2)) {
rprintf(FINFO, "hash search b=%ld len=%s\n",
(long)s->blength, big_num(len, 0));
}
sum = get_checksum1((char *)map, k);
s1 = sum & 0xFFFF;
s2 = sum >> 16;
- if (DEBUG_GTE(CHKSUM, 3))
+ if (DEBUG_GTE(DELTASUM, 3))
rprintf(FINFO, "sum=%.8x k=%ld\n", sum, (long)k);
offset = 0;
end = len + 1 - s->sums[s->count-1].len;
- if (DEBUG_GTE(CHKSUM, 3)) {
+ if (DEBUG_GTE(DELTASUM, 3)) {
rprintf(FINFO, "hash search s->blength=%ld len=%s count=%s\n",
(long)s->blength, big_num(len, 0), big_num(s->count, 0));
}
int done_csum2 = 0;
int32 i;
- if (DEBUG_GTE(CHKSUM, 4)) {
+ if (DEBUG_GTE(DELTASUM, 4)) {
rprintf(FINFO, "offset=%s sum=%04x%04x\n",
big_num(offset, 0), s2 & 0xFFFF, s1 & 0xFFFF);
}
&& !(s->sums[i].flags & SUMFLG_SAME_OFFSET))
continue;
- if (DEBUG_GTE(CHKSUM, 3)) {
+ if (DEBUG_GTE(DELTASUM, 3)) {
rprintf(FINFO,
"potential match at %s i=%ld sum=%08x\n",
big_num(offset, 0), (long)i, sum);
if (len > 0 && s->count > 0) {
build_hash_table(s);
- if (DEBUG_GTE(CHKSUM, 2))
+ if (DEBUG_GTE(DELTASUM, 2))
rprintf(FINFO,"built hash table\n");
hash_search(f, s, buf, len);
- if (DEBUG_GTE(CHKSUM, 2))
+ if (DEBUG_GTE(DELTASUM, 2))
rprintf(FINFO,"done hash search\n");
} else {
OFF_T j;
sender_file_sum[i-1]++;
}
- if (DEBUG_GTE(CHKSUM, 2))
+ if (DEBUG_GTE(DELTASUM, 2))
rprintf(FINFO,"sending file_sum\n");
write_buf(f, sender_file_sum, checksum_len);
- if (DEBUG_GTE(CHKSUM, 2)) {
+ if (DEBUG_GTE(DELTASUM, 2)) {
rprintf(FINFO, "false_alarms=%d hash_hits=%d matches=%d\n",
false_alarms, hash_hits, matches);
}
void match_report(void)
{
- if (!DEBUG_GTE(CHKSUM, 1))
+ if (!DEBUG_GTE(DELTASUM, 1))
return;
rprintf(FINFO,
static const char *debug_verbosity[] = {
/*0*/ NULL,
/*1*/ NULL,
- /*2*/ "bind,cmd,chksum,connect,del,dup,filter,flist",
- /*3*/ "acl,backup,chksum2,del2,exit,filter2,flist2,fuzzy,genr,own,recv,send,time",
- /*4*/ "cmd2,chksum3,del3,exit2,flist3,iconv,own2,proto,time2",
- /*5*/ "chdir,chksum4,flist4,fuzzy2,hlink",
+ /*2*/ "bind,cmd,deltasum,connect,del,dup,filter,flist",
+ /*3*/ "acl,backup,deltasum2,del2,exit,filter2,flist2,fuzzy,genr,own,recv,send,time",
+ /*4*/ "cmd2,deltasum3,del3,exit2,flist3,iconv,own2,proto,time2",
+ /*5*/ "chdir,deltasum4,flist4,fuzzy2,hlink",
};
#define MAX_VERBOSITY ((int)(sizeof debug_verbosity / sizeof debug_verbosity[0]) - 1)
DEBUG_WORD(BIND, W_CLI, "Debug socket bind actions"),
DEBUG_WORD(CHDIR, W_CLI|W_SRV, "Debug when the current directory changes"),
DEBUG_WORD(CONNECT, W_CLI, "Debug connection events"),
- DEBUG_WORD(CHKSUM, W_SND|W_REC, "Debug delta-transfer checksumming (levels 1-4)"),
DEBUG_WORD(CMD, W_CLI, "Debug commands+options that are issued (levels 1-2)"),
DEBUG_WORD(DEL, W_REC, "Debug delete actions (levels 1-3)"),
+ DEBUG_WORD(DELTASUM, W_SND|W_REC, "Debug delta-transfer checksumming (levels 1-4)"),
DEBUG_WORD(DUP, W_REC, "Debug weeding of duplicate names"),
DEBUG_WORD(EXIT, W_CLI|W_SRV, "Debug exit events (levels 1-2)"),
DEBUG_WORD(FILTER, W_SND|W_REC, "Debug filter actions (levels 1-2)"),
if (fd_r >= 0 && size_r > 0) {
int32 read_size = MAX(sum.blength * 2, 16*1024);
mapbuf = map_file(fd_r, size_r, read_size, sum.blength);
- if (DEBUG_GTE(CHKSUM, 2)) {
+ if (DEBUG_GTE(DELTASUM, 2)) {
rprintf(FINFO, "recv mapped %s of size %s\n",
fname_r, big_num(size_r, 0));
}
show_progress(offset, total_size);
if (i > 0) {
- if (DEBUG_GTE(CHKSUM, 3)) {
+ if (DEBUG_GTE(DELTASUM, 3)) {
rprintf(FINFO,"data recv %d at %s\n",
i, big_num(offset, 0));
}
stats.matched_data += len;
- if (DEBUG_GTE(CHKSUM, 3)) {
+ if (DEBUG_GTE(DELTASUM, 3)) {
rprintf(FINFO,
"chunk[%d] of size %ld at %s offset=%s\n",
i, (long)len, big_num(offset2, 0), big_num(offset, 0));
unmap_file(mapbuf);
read_buf(f_in, sender_file_sum, checksum_len);
- if (DEBUG_GTE(CHKSUM, 2))
+ if (DEBUG_GTE(DELTASUM, 2))
rprintf(FINFO,"got file_sum\n");
if (fd != -1 && memcmp(file_sum1, sender_file_sum, checksum_len) != 0)
return 0;
#define DEBUG_BIND (DEBUG_BACKUP+1)
#define DEBUG_CHDIR (DEBUG_BIND+1)
#define DEBUG_CONNECT (DEBUG_CHDIR+1)
-#define DEBUG_CHKSUM (DEBUG_CONNECT+1)
-#define DEBUG_CMD (DEBUG_CHKSUM+1)
+#define DEBUG_CMD (DEBUG_CONNECT+1)
#define DEBUG_DEL (DEBUG_CMD+1)
-#define DEBUG_DUP (DEBUG_DEL+1)
+#define DEBUG_DELTASUM (DEBUG_DEL+1)
+#define DEBUG_DUP (DEBUG_DELTASUM+1)
#define DEBUG_EXIT (DEBUG_DUP+1)
#define DEBUG_FILTER (DEBUG_EXIT+1)
#define DEBUG_FLIST (DEBUG_FILTER+1)
s->sums = NULL;
- if (DEBUG_GTE(CHKSUM, 3)) {
+ if (DEBUG_GTE(DELTASUM, 3)) {
rprintf(FINFO, "count=%s n=%ld rem=%ld\n",
big_num(s->count, 0), (long)s->blength, (long)s->remainder);
}
if (allowed_lull && !(i % lull_mod))
maybe_send_keepalive();
- if (DEBUG_GTE(CHKSUM, 3)) {
+ if (DEBUG_GTE(DELTASUM, 3)) {
rprintf(FINFO,
"chunk[%d] len=%d offset=%s sum1=%08x\n",
i, s->sums[i].len, big_num(s->sums[i].offset, 0),
} else
mbuf = NULL;
- if (DEBUG_GTE(CHKSUM, 2)) {
+ if (DEBUG_GTE(DELTASUM, 2)) {
rprintf(FINFO, "send_files mapped %s%s%s of size %s\n",
path,slash,fname, big_num(st.st_size, 0));
}
fnamecmp_type, xname, xlen);
write_sum_head(f_xfer, s);
- if (DEBUG_GTE(CHKSUM, 2))
+ if (DEBUG_GTE(DELTASUM, 2))
rprintf(FINFO, "calling match_sums %s%s%s\n", path,slash,fname);
if (log_before_transfer)