search for: sum_length

Displaying 17 results from an estimated 17 matches for "sum_length".

Did you mean: csum_length
2005 Jun 27
5
adding a new log-format escape
...@@ -483,6 +483,13 @@ snprintf(buf2, sizeof buf2, fmt, (double)b); n = buf2; break; + case 's': + strlcat(fmt, "02x", sizeof fmt); + for (j = 0; j < SUM_LENGTH; j++ ) { + snprintf(buf2 + j * 2, sizeof buf2, fmt, file->u.sum[j]); + } + n = buf2; + break; case 'i': if (iflags & ITEM_DELETED) {...
2003 Mar 30
1
[RFC][patch] dynamic rolling block and sum sizes II
...emote_version >= 27) + write_int(f, sum->s2length); + write_int(f, sum->remainder); } @@ -164,19 +172,18 @@ sum.count = (len + (block_len - 1)) / block_len; sum.remainder = (len % block_len); - sum.n = block_len; + sum.blength = block_len; sum.flength = len; + sum.s2length = csum_length; /* not needed here sum.sums = NULL; */ if (sum.count && verbose > 3) { rprintf(FINFO, "count=%ld rem=%ld n=%ld flength=%.0f\n", (long) sum.count, (long) sum.remainder, - (long) sum.n, (double) sum.flength); + (long) sum.blength, (double) sum.flength); } -...
2003 Mar 22
2
[RFC] protocol version
I'm in the midst of coding a patch set for consideration that will bump the protocol version and have a couple of observations. The current minimum backwards-compatible protocol is 15 but we have code that checks for protocol versions as old as 12. If someone else doesn't beat me to it i'm considering cleaning out the pre-15 compatibility code. A backwards compatibility patch could
2003 May 09
2
Revisiting two old issues
I'd like some opinions on a couple of long-standing rsync issues. My two oldest, uncommitted patches are: - A "no hang" patch that makes sure that the pipe from the receiver to the generator can't block with resend requests. - The "move files" patch that got changed into a --delete-sent-files option. For each item I have two questions -- do we need to
2002 Aug 05
5
[patch] read-devices
...tly inflate the patch. Also, this shouldn't prevent map_ptr() from being a wrapper to mmap() in the future, though the map_ptr() code will need to contain a fallback to read(). 3. Character devices and FIFO files can be read only once, so we can't "redo" them in the adaptive csum_length scheme (I think that it's safe to assume that block devices can be read multiple times, though). Thus such files must always be transferred with a generous csum_length, say, at least 8 bytes. I'm not sure how to handle this protocol-wise; as a temporary measure, I increased the initial...
2003 Oct 05
2
Possible security hole
...der.c:receive_sums() s->count = read_int(f); .. s->sums = (struct sum_buf *)malloc(sizeof(s->sums[0])*s->count); if (!s->sums) out_of_memory("receive_sums"); for (i=0; i < (int) s->count;i++) { s->sums[i].sum1 = read_int(f); read_buf(f,s->sums[i].sum2,csum_length); .. If I read this right, given high enough s->count makes the malloc() parameter wraps around to a few bytes while still reading data past it. Exploiting is probably pretty difficult if at all possible. There would have to be some interesting data after the returned pointer. I didn't...
2002 Mar 06
0
rsync hangs in read_int (generator.c line 498)
...wo of the three have a very shallow structure, and they work fine. The third, however, has a fairly deep structure and many more files than the other two, and rsync'ing this directory causes a hang on the client side. Firing up gdb, I get: (gdb) list 486 phase++; 487 csum_length = SUM_LENGTH; 488 ignore_times=1; 489 490 if (verbose > 2) 491 rprintf(FINFO,"generate_files phase=%d\n",phase); 492 493 write_int(f,-1); 494 495 if (remote_version >= 13) { (gdb) n generate_files phase=1 493...
2002 Apr 23
1
patch: timeout problem solved
...e - doing and how many bytes there are in the last - chunk */ - write_int(f_out, s->count); - write_int(f_out, s->n); - write_int(f_out, s->remainder); - - for (i = 0; i < s->count; i++) { - write_int(f_out, s->sums[i].sum1); - write_buf(f_out, s->sums[i].sum2, csum_length); - } - } else { - /* we don't have checksums */ - write_int(f_out, 0); - write_int(f_out, block_size); - write_int(f_out, 0); - } + /* we don't have checksums */ + write_int(f_out, 0); + write_int(f_out, block_size); + write_int(f_out, 0); } @@ -162,57 +146,43 @@ generate ap...
2024 Mar 18
0
[PATCH] add option to skip files based on age/mtime
...+2175,13 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo) if (check_redo && (ndx = get_redo_num()) != -1) { OFF_T save_max_size = max_size; OFF_T save_min_size = min_size; + int save_max_age = max_age; + int save_min_age = min_age; csum_length = SUM_LENGTH; max_size = -1; min_size = -1; + max_age = 0; + min_age = 0; ignore_existing = -ignore_existing; ignore_non_existing = -ignore_non_existing; update_only = -update_only; @@ -2184,6 +2207,8 @@ void check_for_finished_files(int itemizing, enum logcode code, i...
2003 Mar 23
1
[RFC] dynamic checksum size
...r versions: the onus is on @@ -385,7 +385,8 @@ OFF_T flength; /**< total file length */ size_t count; /**< how many chunks */ size_t remainder; /**< flength % block_length */ - size_t n; /**< block_length */ + size_t blength; /**< block_length */ + size_t s2length; /**< csum_length */ struct sum_buf *sums; /**< points to info for each chunk */ }; --- generator.c Sat Mar 22 03:38:21 2003 +++ generator.c.dynsumlen Sat Mar 22 09:47:43 2003 @@ -109,13 +109,21 @@ /* - send a header that says "we have no checksums" down the f_out fd + * NULL sum_struct me...
2005 Apr 25
2
How about a --min-size option, next to --max-size
There's a rather old bug report in Debian's bug tracking system (see http://bugs.debian.org/27126) about wanting to be able to specify the maximum file size, as well as the minimum file size. Here's the text: Sometimes, it's useful to specify a file size range one is interested in. For example, I'd like to keep an up-to-date mirror of Debian, but I currently
2007 Aug 20
5
DO NOT REPLY [Bug 4899] New: When a mounted dir cannot be visited, rsync will halt there and the shell is halted, even "ctrl -c" can't quit it.
...r is filtered out, rsync should work well. Solution: Modified "flist.c", struct file_struct *make_file(char *fname, struct file_list *flist, STRUCT_STAT *stp, unsigned short flags, int filter_level) { ... memset(sum, 0, SUM_LENGTH); /* In case a mounted dir crashed, than stat will hang there even the dir has been filtered */ if (filter_level != NO_FILTERS && is_excluded(thisname, 1, filter_level)) { rprintf(FINFO, "Excluding %s\n", thisname);...
2004 Aug 02
4
reducing memmoves
Attached is a patch that makes window strides constant when files are walked with a constant block size. In these cases, it completely avoids all memmoves. In my simple local test of rsyncing 57MB of 10 local files, memmoved bytes went from 18MB to zero. I haven't tested this for a big variety of file cases. I think that this will always reduce the memmoves involved with walking a large
2004 Jan 17
1
--delete-sent-files (AKA --move-files)
...f[MAXPATHLEN]; struct map_struct *mapbuf; int i; @@ -461,16 +462,20 @@ int recv_files(int f_in,struct file_list cleanup_disable(); - if (!recv_ok) { + if (recv_ok) { + if (delete_sent_files) { + SIVAL(numbuf, 0, i); + send_msg(MSG_SUCCESS, numbuf, 4); + } + } else { if (csum_length == SUM_LENGTH) { rprintf(FERROR,"ERROR: file corruption in %s. File changed during transfer?\n", full_fname(fname)); } else { - char buf[4]; if (verbose > 1) rprintf(FINFO,"redoing %s(%d)\n",fname,i); - SIVAL(buf, 0, i); - send_msg(MSG_REDO,...
2004 Jun 17
1
[PATCH] make write_batch local
...**** *** 256,265 **** --- 267,295 ---- write_buf(f_out, sum2, sum.s2length); len -= n1; offset += n1; + + if (write_batch) { /* we're receiver */ + /* we only have to save the sums + * if we want to write them out */ + sum.sums[i].sum1 = sum1; + for (j = 0; j < SUM_LENGTH ; j++) + sum.sums[i].sum2[j] = sum2[j]; + } + } + if (write_batch) { + write_batch_csum_info(&flist_idx, &sum); + free(sum.sums); } } + void write_null_sum(int f_out, int i) { + write_int(f_out, i); + if (!dry_run) write_sum_head(f_out, NULL); + if (write_batch) {...
2005 Mar 21
4
Patch: Offline transfer mode
.../ + f_alt = open("/dev/null", O_RDWR); + write_batch_monitor_out = f_alt; + } else { + f_alt = f_out; + } + while (1) { unsigned int offset; i = read_int(f_in); if (i == -1) { if (phase == 0) { + write_batch_monitor_out = old_monitor; phase++; csum_length = SUM_LENGTH; write_int(f_out, -1); @@ -173,7 +187,7 @@ if (dry_run) { if (!am_server && verbose) /* log the transfer */ rprintf(FINFO, "%s\n", safe_fname(fname2)); - write_int(f_out, i); + write_int(f_alt, i); continue; } @@ -224,8 +238,8 @@ saf...
2002 Feb 07
1
Latest version of the batch mode cleanup patch
...sizeof (int)); + write_batch_csums_file(s ? &s->count : &int_zero, sizeof(int)); if (s) { for (i = 0; i < s->count; i++) { @@ -417,8 +414,7 @@ && (i == s->count - 1)) { fdb_close = 1; } - write_batch_csums_file(s->sums[i].sum2, - csum_length); + write_batch_csums_file(s->sums[i].sum2, csum_length); } } } @@ -427,17 +423,18 @@ { static int fdb_open = 1; int bytes_read; + char filename[MAXPATHLEN]; if (fdb_open) { - - /* Set up file extension */ - strcat(rsync_csums_file, batch_file_ext); + /* Set up file extensi...