From 86e30a0166f9c9e65983d2c4066873c4181d08c8 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 28 Aug 2009 11:21:06 +1000 Subject: [PATCH] - (dtucker) [clientloop.c configure.ac defines.h] Make the client's IO buffer size a compile-time option and set it to 64k on Cygwin, since Corinna reports that it makes a significant difference to performance. ok djm@ --- ChangeLog | 3 +++ clientloop.c | 4 ++-- configure.ac | 5 +++-- defines.h | 6 +++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e24f73274..89bfa66a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,9 @@ the pty master on Solaris, since it never succeeds and can hang if large amounts of data is sent to the slave (eg a copy-paste). Based on a patch originally from Doke Scott, ok djm@ + - (dtucker) [clientloop.c configure.ac defines.h] Make the client's IO buffer + size a compile-time option and set it to 64k on Cygwin, since Corinna + reports that it makes a significant difference to performance. ok djm@ 20090820 - (dtucker) [includes.h] Bug #1634: do not include system glob.h if we're not diff --git a/clientloop.c b/clientloop.c index b8352f6bf..9a7dc0ab0 100644 --- a/clientloop.c +++ b/clientloop.c @@ -636,7 +636,7 @@ static void client_process_net_input(fd_set *readset) { int len, cont = 0; - char buf[8192]; + char buf[SSH_IOBUFSZ]; /* * Read input from the server, and add any such data to the buffer of @@ -1129,7 +1129,7 @@ static void client_process_input(fd_set *readset) { int len; - char buf[8192]; + char buf[SSH_IOBUFSZ]; /* Read input from stdin. */ if (FD_ISSET(fileno(stdin), readset)) { diff --git a/configure.ac b/configure.ac index 5f5a08a0a..ef0b0fc97 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.423 2009/08/28 01:02:37 dtucker Exp $ +# $Id: configure.ac,v 1.424 2009/08/28 01:21:07 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.423 $) +AC_REVISION($Revision: 1.424 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -446,6 +446,7 @@ int main(void) { exit(0); } AC_DEFINE(DISABLE_FD_PASSING, 1, [Define if your platform needs to skip post auth file descriptor passing]) + AC_DEFINE(SSH_IOBUFSZ, 65536, [Windows is sensitive to read buffer size]) ;; *-*-dgux*) AC_DEFINE(IP_TOS_IS_BROKEN, 1, diff --git a/defines.h b/defines.h index 2ccded266..2ddfd96d0 100644 --- a/defines.h +++ b/defines.h @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.155 2009/06/16 06:11:02 dtucker Exp $ */ +/* $Id: defines.h,v 1.156 2009/08/28 01:21:07 dtucker Exp $ */ /* Constants */ @@ -749,4 +749,8 @@ struct winsize { #define INET6_ADDRSTRLEN 46 #endif +#ifndef SSH_IOBUFSZ +# define SSH_IOBUFSZ 8192 +#endif + #endif /* _DEFINES_H */