From: Andrew Tridgell Date: Mon, 24 Jan 2000 12:23:39 +0000 (+0000) Subject: reinstated the MAX_READ_BUFFER code. Its a nasty tradeoff - using lots X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/cbce490e138d7bbc7bf982496861f093732dfba9 reinstated the MAX_READ_BUFFER code. Its a nasty tradeoff - using lots of memory vs. ssh bugs. uggh. --- diff --git a/io.c b/io.c index 3930e47e..26b6e4b3 100644 --- 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 a86baaa4..53cd02a2 100644 --- 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