reinstated the MAX_READ_BUFFER code. Its a nasty tradeoff - using lots
authorAndrew Tridgell <tridge@samba.org>
Mon, 24 Jan 2000 12:23:39 +0000 (12:23 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 24 Jan 2000 12:23:39 +0000 (12:23 +0000)
of memory vs. ssh bugs. uggh.

io.c
rsync.h

diff --git a/io.c b/io.c
index 3930e47..26b6e4b 100644 (file)
--- a/io.c
+++ b/io.c
@@ -255,9 +255,6 @@ static void read_check(int f)
                read_buffer_p = read_buffer;
        }
 
-       if (n > MAX_READ_BUFFER/4)
-               n = MAX_READ_BUFFER/4;
-
        if (read_buffer_p != read_buffer) {
                memmove(read_buffer,read_buffer_p,read_buffer_len);
                read_buffer_p = read_buffer;
@@ -385,7 +382,8 @@ static void writefd_unbuffered(int fd,char *buf,int len)
                fd_count = fd;
 
                if (!no_flush_read) {
-                       reading = (buffer_f_in != -1);
+                       reading = (buffer_f_in != -1) && 
+                               (read_buffer_len < MAX_READ_BUFFER);
                }
 
                if (reading) {
diff --git a/rsync.h b/rsync.h
index a86baaa..53cd02a 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -58,7 +58,7 @@
 #define CHUNK_SIZE (32*1024)
 #define MAX_MAP_SIZE (256*1024)
 #define IO_BUFFER_SIZE (4092)
-#define MAX_READ_BUFFER (1024*1024)
+#define MAX_READ_BUFFER (10*1024*1024)
 
 #define MAX_ARGS 1000