search for: write_int

Displaying 20 results from an estimated 50 matches for "write_int".

2002 Apr 23
1
patch: timeout problem solved
...102,12 @@ /* send a sums struct down a fd */ -static void send_sums(struct sum_struct *s, int f_out) +static void send_null_sums(int f_out) { - if (s) { - size_t i; - - /* tell the other guy how many we are going to be - 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_o...
2003 Mar 30
1
[RFC][patch] dynamic rolling block and sum sizes II
...+ generator.c Sat Mar 29 12:16:02 2003 @@ -116,13 +116,21 @@ /* - send a header that says "we have no checksums" down the f_out fd + * NULL sum_struct means we have no checksums */ -static void send_null_sums(int f_out) + +void write_sum_head(int f, struct sum_struct *sum) { - write_int(f_out, 0); - write_int(f_out, block_size); - write_int(f_out, 0); + static struct sum_struct null_sum; + + if (sum == (struct sum_struct *)NULL) + sum = &null_sum; + + write_int(f, sum->count); + write_int(f, sum->blength); + if (remote_version >= 27) + write_int(f, sum->s2length)...
2003 Mar 23
1
[RFC] dynamic checksum size
...or.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 means we have no checksums */ -static void send_null_sums(int f_out) + +void write_sum_head(int f, struct sum_struct *sum) { - write_int(f_out, 0); - write_int(f_out, block_size); - write_int(f_out, 0); + static struct sum_struct null_sum; + + if (sum == (struct sum_struct *)NULL) + sum = &null_sum; + + write_int(f, sum->count); + write_int(f, sum->blength); + if (remote_version >= 27) + write_int(f, sum->s2length)...
2001 Aug 06
1
merge rsync+ into rsync (was Re: rsync-2.4.7 NEWS file)
> Just curious: what about the rsync+ patch? Thanks for the reminder. I've just committed Jos's rsync+ patch onto the "branch_mbp_rsyncplus_merge" branch. If it works OK and nobody screams I will move it across onto the main tree tomorrow or Wednesday. I see the patch doesn't add documentation about the new options to the man page, so we should fix that in the future.
2004 Jul 12
2
[PATCH] Batch-mode rewrite
...incoming mode */ + write_batch = 0; /* don't write RSYNCD protocol to file */ if (argc == 0 && !am_sender) list_only = 1; *************** *** 200,205 **** --- 212,221 ---- io_start_multiplex_in(f_in); } + if (write_batch_temp) /* fudge the protocol version */ + write_int(batch_fd, remote_protocol); + + write_batch = write_batch_temp; /* restore incoming mode */ return 0; } Index: compat.c =================================================================== RCS file: /cvsroot/rsync/compat.c,v retrieving revision 1.22 diff -c -b -d -r1.22 compat.c *** compa...
2004 Jul 11
0
[PATCH] [TRIVIAL] whitespace + variable rename
...le, i, f); } phase++; --- 586,592 ---- } recv_generator(local_name ? local_name : f_name_to(file, fbuf), ! file, i, f_out); } phase++; *************** *** 594,614 **** if (verbose > 2) rprintf(FINFO,"generate_files phase=%d\n",phase); ! write_int(f,-1); /* files can cycle through the system more than once * to catch initial checksum errors */ while ((i = get_redo_num()) != -1) { struct file_struct *file = flist->files[i]; recv_generator(local_name ? local_name : f_name_to(file, fbuf), ! file, i, f); }...
2003 Apr 27
1
Rsync read_int questions
..., I do see a couple of issues. Using 2.5.6 source code, line 314 of exclude.c has an unsigned int, but its value is set by read_int - which is signed. Next, I follow read_int->readfd->read_unbuffered->read_timeout->read. Nowhere in this chain do a see a ntoh conversion. I traced through write_int and I don't see any hton conversions in the call chain either. How do you ensure an int is in the proper byte order across a network? Also, should read_int & write_int use a union to enforce proper alignment? union int_align { char b[4]; int32 foo; }; All the errors I see seem to b...
2003 Jan 03
1
[Fwd: Re: rsync windows -> unix still hanging :(]
..._in != f_out) close(f_in); ! io_start_buffering(f_out); io_set_error_fd(error_pipe[0]); --- 423,429 ---- close(error_pipe[1]); if (f_in != f_out) close(f_in); ! io_start_buffering_out(f_out); io_set_error_fd(error_pipe[0]); *************** *** 434,440 **** write_int(f_out, -1); } io_flush(); ! kill(pid, SIGUSR2); wait_process(pid, &status); return status; --- 436,442 ---- write_int(f_out, -1); } io_flush(); ! msleep(100); kill(pid, SIGUSR2); wait_process(pid, &status); return status; ******...
2004 Jun 17
1
[PATCH] make write_batch local
...ant 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) { + write_batch_csum_info(&i, NULL); + } + } /** * Acts on file number @p i from @p flist, whose name is @p fname. *************** *** 453,460 **** if (preserve_hard_links && hard_link_check(file...
2005 Jan 05
1
rsync filename heuristics
...fname); > - statret = link_stat(fnamecmpbuf,&st); > - if (!S_ISREG(st.st_mode)) > - statret = -1; > - if (statret == -1) > - errno = saveerrno; > - else > - fnamecmp = fnamecmpbuf; > - } > - > - if (statret == -1) { > - if (errno == ENOENT) { > - write_int(f_out,i); > - if (!dry_run) send_sums(NULL,f_out); > - } else { > - if (verbose > 1) > - rprintf(FERROR, RSYNC_NAME > - ": recv_generator failed to open \"%s\": %s\n", > - fname, strerror(errno)); > - } > - return; > - } > - &gt...
2002 Mar 06
0
rsync hangs in read_int (generator.c line 498)
...g 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 write_int(f,-1); (gdb) n 495 if (remote_version >= 13) { (gdb) print remote_version $1 = 26 (gdb) n 498 for (i=read_int(f_recv); i != -1; i=read_int(f_recv)) {...
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 Nov 29
1
bogus hardlinks bug?
dear rsyncists, rsync is superb! but did i actually find a bug? i did: $ rsync -vRHSPa rsync://rsync.mirror.ac.uk/updates.redhat.com/7.3/en/os/SRPMS . into an empty local directory the result was 140 bogus hardlinks of the same file: -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24 Canna-3.5b2-62.7.3.src.rpm -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24
2002 Aug 05
5
[patch] read-devices
...file->sum,2) == 0); } else { return (memcmp(sum,file->sum,MD4_SUM_LENGTH) == 0); @@ -119,8 +120,9 @@ write_buf(f_out, s->sums[i].sum2, csum_length); } } else { /* we don't have checksums */ + rprintf(FINFO, "#ET# send_sums: don't have checksums\n"); write_int(f_out, 0); write_int(f_out, block_size); write_int(f_out, 0); } @@ -193,24 +195,23 @@ s->sums = (struct sum_buf *)malloc(sizeof(s->sums[0])*s->count); if (!s->sums) out_of_memory("generate_sums"); for (i=0;i<count;i++) { - int n1 = MIN(len,n); - char *ma...
2002 Apr 03
3
metadata in dryrun mode
As I reported a while back rsync doesn't handle metadata (permissions and ownership) in dryrun mode. I offered to make a patch and that offer still stands. I didn't have the time for it until now and want to pick it up again. I had some ugly hack back then but I want to redo it in a clean way. I would like some input on my thoughts. IMHO, it would be ideally if the check for dry_run
2015 Dec 26
0
About data/token send/receive protocol part and more
...return i; + } residue = i; } @@ -252,8 +256,11 @@ static void simple_send_token(int f, int } } /* a -2 token means to send data only and no token */ - if (token != -2) + if (token != -2) { write_int(f, -(token+1)); + if (protocol_version >= 32) + write_int(f, -(2*(token+1))); /* additional metadata */ + } } /* Flag bytes in compressed stream are encoded as follows: */ ----------------------------------------------------------------------------...
2003 Jun 27
5
PATCH/RFC: Another stab at the Cygwin hang problem
...+ io_flush(); if ((pid=do_fork()) == 0) { + char tmp; + close(recv_pipe[0]); close(error_pipe[0]); + close(cleanup_pipe[1]); if (f_in != f_out) close(f_out); /* we can't let two processes write to the socket at one time */ *************** *** 436,450 **** write_int(recv_pipe[1],1); close(recv_pipe[1]); io_flush(); ! /* finally we go to sleep until our parent kills us ! with a USR2 signal. We sleep for a short time as on ! some OSes a signal won't interrupt a sleep! */ ! while (msleep(20)) ! ; } close(recv_pipe[1]); clo...
2003 Jul 07
1
Some C help patching sender.c (from:plain source -> encrypted destination: rsync + gpg)
...e under if(read_batch). Is read_batch always true when using --whole-files? Seems to be. Second concern: where is the reading and transmission of th file happening? If the do_open is in line 183, where's the read/transmit, map_file() line 202 puts the data uin buf, and then, what? You see, write_int doesn't use buf. And where is the handle closed? Thanks for any tips here... Ahhh, life. martin http://nzl.com.ar/
2005 Mar 21
4
Patch: Offline transfer mode
...ull", 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 @@ safe_fname(fname), (double)st.st...
2004 Jan 25
2
scan for first existing hard-link file
...440,11 @@ void recv_generator(char *fname, struct } if (statret == -1) { + if (preserve_hard_links && file->link_u.links + && !(file->flags & FLAG_HLINK_LAST)) { + hlink_list[file->F_INDEX] = file->F_NEXT; + return; + } if (errno == ENOENT) { write_int(f_out,i); if (!dry_run) write_sum_head(f_out, NULL); @@ -455,6 +462,11 @@ void recv_generator(char *fname, struct } /* now pretend the file didn't exist */ + if (preserve_hard_links && file->link_u.links + && !(file->flags & FLAG_HLINK_LAST)) { + h...