search for: write_buf

Displaying 20 results from an estimated 34 matches for "write_buf".

2002 Jan 13
0
rsynd-2.5.1 / io.c patches
...-573,7 +588,7 @@ void write_longint(int f, int64 x) { extern int remote_version; - char b[8]; + unsigned char b[8]; if (remote_version < 16 || x <= 0x7FFFFFFF) { write_int(f, (int)x); @@ -587,13 +602,13 @@ writefd(f,b,8); } -void write_buf(int f,char *buf,int len) +void write_buf(int f,const void *buf,int len) { writefd(f,buf,len); } /* write a string to the connection */ -static void write_sbuf(int f,char *buf) +static void write_sbuf(int f,const char *buf) { write_buf(f, buf, strlen(buf)); } @@ -601,13...
2006 Jun 12
0
Some questions about function usage
...er of the first block of target inode. But target_blks[1] and target_blks[2] always 0(zero). Why and how I get the correct an array of blocks? 2. I get a "Attempt to write block from filesystem resulted in short write" when I calling io_channel_write_byte( ). Why? My code: unsigned char write_buf[4096]; retval = io_channel_write_byte(fs->io, 100581, -4096, write_buf); if (retval) { com_err (program_name, retval, "while callng io_channel_write_byte"); printf ("Failure: Calling function io_channel_write_byte.\n"); exit (1); } 3. I can usin...
2013 May 23
2
Problem with btrfs send/receive
Hi everyone, I was trying the new send/receive feature today but can''t make it work. These are the commands I was using: btrfs subvol snap -r /mnt/data1/@downloads/ /mnt/data1/snapshots/testsnap btrfs send /mnt/data1/snapshots/testsnap | btrfs receive /mnt/data1/snapshots/testreceive/ This command never finishes. A ''ls /mnt/data1/snapshots/testreceive/ '' never
2006 Jun 29
3
hotuser and hotkernel
...% gunzip`unzip 1 0.1% ld.so.1`strcmp 1 0.1% gunzip`inflate_dynamic 1 0.1% libc.so.1`_write 1 0.1% gunzip`write_buf 1 0.1% gunzip`0x2d990 2 0.3% libc.so.1`write 2 0.3% gunzip`0x2d994 2 0.3% ld.so.1`rtld_db_preinit...
2002 Apr 23
1
patch: timeout problem solved
...e 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_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); }...
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.
2009 Nov 04
0
PATCH: fast copy of files in local server mode
...LL; int32 i; char *map = NULL; + int percent = 0; read_sum_head(f_in, &sum); + if (local_server && local_socket && sum.count == 0) { + int i = recv_fd(local_socket); + rprintf(FINFO,"received file descriptor %d\n", i); + if (i <= 0) + offset = -1; + write_buf(local_socket, (char *)&offset, sizeof(offset)); + if (i <= 0) + return 0; + f_in = -i; + } + 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); @@ -231,11 +245,18 @@ stats.lite...
2009 Apr 22
2
[Code study] lp_motd_file defination? Help
...Many thanks. #line 147 ~ 160, in clientserver.c, version 3.0.5 > if (!am_client) { > motd = lp_motd_file(); > if (motd && *motd) { > FILE *f = fopen(motd,"r"); > while (f && !feof(f)) { > int len = fread(buf, 1, bufsiz - 1, f); > if (len > 0) > write_buf(f_out, buf, len); > } > if (f) > fclose(f); > write_sbuf(f_out, "\n"); > } > } $ grep "lp_motd_file" . -R ./proto.h:char *lp_motd_file(void); ./loadparm.c:FN_GLOBAL_STRING(lp_motd_file, &Globals.motd_file) ./clientserver.c: motd = lp_motd_file(); -- Da...
2009 Apr 27
1
[Code study]should we remove if (motd && *motd) section?
...n advance. clientserver.c #line 147~160 > if (!am_client) { > motd = lp_motd_file(); > if (motd && *motd) { > FILE *f = fopen(motd,"r"); > while (f && !feof(f)) { > int len = fread(buf, 1, bufsiz - 1, f); > if (len > 0) > write_buf(f_out, buf, len); > } > if (f) > fclose(f); > write_sbuf(f_out, "\n"); > } > } > static void init_globals(void) > { > memset(&Globals, 0, sizeof Globals); > } > -- Daniel
2002 Nov 11
0
Regular Expression support
...if (remote_version < 25) { + rprintf(FERROR,"remote rsync does not support regular expressions syntax - aborting\n"); + exit_cleanup(RERR_UNSUPPORTED); + } + if (exclude_list[i]->include) { + write_int(f,l+3); + write_buf(f,"+R ",3); + }else{ + write_int(f,l+3); + write_buf(f,"-R ",3); + } + }else{ if (exclude_list[i]->include) { if (remote_version < 19) { rprintf(FERROR,"remote rsync doe...
2006 Jan 09
2
performance with >50GB files
Hi all, today we had a performance issue transfering a big amount of data where one file was over 50GB. Rsync was tunneled over SSH and we expected the data to be synced within hours. However after over 10 hours the data is still not synced ... The sending box has rsync running with 60-80 % CPU load (2GHz Pentium 4) while the receiver is nearly idle. So far I had no acces to the poblematic
2003 Mar 30
1
[RFC][patch] dynamic rolling block and sum sizes II
...nt(f_out, sum.count); - write_int(f_out, sum.n); - write_int(f_out, sum.remainder); + write_sum_head(f_out, &sum); for (i = 0; i < sum.count; i++) { int n1 = MIN(len, block_len); @@ -192,7 +199,7 @@ i, (double) offset, n1, (unsigned long) sum1); } write_int(f_out, sum1); - write_buf(f_out, sum2, csum_length); + write_buf(f_out, sum2, sum.s2length); len -= n1; offset += n1; } @@ -384,7 +391,7 @@ if (statret == -1) { if (errno == ENOENT) { write_int(f_out,i); - if (!dry_run) send_null_sums(f_out); + if (!dry_run) write_sum_head(f_out, NULL); } else {...
2004 Dec 07
1
rsync hangs when tunneling... help!
...ack traces of hung transfer: Client: #0 0x280bf6c8 in select () from /usr/lib/libc.so.3 #1 0x8058124 in writefd_unbuffered (fd=3, buf=0x92b8000 "...", len=32768) at io.c:865 #2 0x8058447 in writefd (fd=3, buf=0x92b8000 "...", len=32768) at io.c:981 #3 0x8058551 in write_buf (f=3, buf=0x92b8000 "...", len=32768) at io.c:1045 #4 0x8058ff8 in simple_send_token (f=3, token=-2, buf=0x807d0c0, offset=3833856, n=32768) at token.c:104 #5 0x80598c0 in send_token (f=3, token=-2, buf=0x807d0c0, offset=3833856, n=32768, toklen=0) at token.c:472 #6 0x80510...
2002 Aug 05
5
[patch] read-devices
...e_dest,fname); fname = fnamecmpdest; } } - file_checksum(fname,sum,st->st_size); + file_checksum(fname,sum); if (remote_version < 21) { return (memcmp(sum,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...
2003 Mar 21
2
x>>32 warning in io.c
I download rsync.2.5.6, configure, make clean, but make gives this warning: "io.c", line 653: warning: shift count negative or too big: >> 32 "io.c", line 653: warning: shift count negative or too big: >> 32 "io.c", line 653: warning: shift count negative or too big: >> 32 "io.c", line 653: warning: shift count negative or too big:
2003 Mar 23
1
[RFC] dynamic checksum size
...nt(f_out, sum.count); - write_int(f_out, sum.n); - write_int(f_out, sum.remainder); + write_sum_head(f_out, &sum); for (i = 0; i < sum.count; i++) { int n1 = MIN(len, block_len); @@ -185,7 +192,7 @@ i, (double) offset, n1, (unsigned long) sum1); } write_int(f_out, sum1); - write_buf(f_out, sum2, csum_length); + write_buf(f_out, sum2, sum.s2length); len -= n1; offset += n1; } @@ -377,7 +384,7 @@ if (statret == -1) { if (errno == ENOENT) { write_int(f_out,i); - if (!dry_run) send_null_sums(f_out); + if (!dry_run) write_sum_head(f_out, NULL); } else {...
2020 Jul 14
0
[PATCH nbdkit RFC 2/2] curl: Implement authorization scripts.
...rn bool tcp_nodelay; +extern uint32_t timeout; +extern const char *unix_socket_path; +extern const char *user; +extern const char *user_agent; + +/* The per-connection handle. */ +struct curl_handle { + CURL *c; + bool accept_range; + int64_t exportsize; + char errbuf[CURL_ERROR_SIZE]; + char *write_buf; + uint32_t write_count; + const char *read_buf; + uint32_t read_count; + struct curl_slist *auth_headers; +}; + +/* auth-script.c */ +extern int do_auth_script (struct curl_handle *h); +extern void auth_script_unload (void); + +#endif /* NBDKIT_CURLDEFS_H */ diff --git a/plugins/curl/auth-scri...
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
2002 Jul 02
1
Rsync: Segmentation fault
Rsync 2.5.5; transfer via ssh; sparc-sun-solaris2.5 (Ultra 1); gcc 2.8.1. Every time rsync on this box causes boundary violation. I attached two strange examples. I have a few rsync's corefiles (100MB and above) and I can examine them. I will be grateful for any help. -Mirek <-------------------------------------------------------------------------> received 966761 names done
2001 Aug 22
1
@RSYNC EXIT / @RSYNC EOF
...uf(int f,char *buf,int len) { - read_buf(f,buf,len); + read_buf (f,buf,len); buf[len] = 0; } unsigned char read_byte(int f) { unsigned char c; - read_buf(f,(char *)&c,1); + read_buf (f, (char *)&c, 1); return c; } @@ -560,10 +595,10 @@ void write_byte(int f,unsigned char c) write_buf(f,(char *)&c,1); } + + int read_line(int f, char *buf, int maxlen) { - eof_error = 0; - while (maxlen) { buf[0] = 0; read_buf(f, buf, 1); @@ -581,8 +616,6 @@ int read_line(int f, char *buf, int maxl *buf = 0; return 0; } - - eof_error = 1; return 1; } Index: proto.h ==...