aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2009-10-25 22:22:03 -0700
committerWayne Davison <wayned@samba.org>2009-10-25 22:27:01 -0700
commit4dde3347fb614270f6aa6812598185aa0ccca3ef (patch)
treee085cf016d2623e6914e190981b7c25f13c2f8e6 /io.c
parent44a97a34b151a3a4fc4fd4b1c0def483a428e633 (diff)
downloadandroid_external_rsync-4dde3347fb614270f6aa6812598185aa0ccca3ef.tar.gz
android_external_rsync-4dde3347fb614270f6aa6812598185aa0ccca3ef.tar.bz2
android_external_rsync-4dde3347fb614270f6aa6812598185aa0ccca3ef.zip
Fix %b and %c so that they count per-transfer bytes again.
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/io.c b/io.c
index b1748628..b400ba29 100644
--- a/io.c
+++ b/io.c
@@ -76,6 +76,9 @@ int kluge_around_eof = 0;
int sock_f_in = -1;
int sock_f_out = -1;
+int64 total_data_read = 0;
+int64 total_data_written = 0;
+
static struct {
xbuf in, out, msg;
int in_fd;
@@ -1578,6 +1581,7 @@ void read_buf(int f, char *buf, size_t len)
if (!IN_MULTIPLEXED) {
memcpy(buf, perform_io(len, PIO_INPUT_AND_CONSUME), len);
+ total_data_read += len;
if (forward_flist_data)
write_buf(iobuf.out_fd, buf, len);
batch_copy:
@@ -1601,6 +1605,7 @@ void read_buf(int f, char *buf, size_t len)
/* The bytes at the "data" pointer will survive long
* enough to make a copy, but not past future I/O. */
memcpy(buf, data, siz);
+ total_data_read += siz;
if (forward_flist_data)
write_buf(iobuf.out_fd, buf, siz);
@@ -1873,6 +1878,7 @@ void write_buf(int f, const char *buf, size_t len)
memcpy(iobuf.out.buf + pos, buf, len);
iobuf.out.len += len;
+ total_data_written += len;
batch_copy:
if (f == write_batch_monitor_out)