Add support for automatically tuning the SSH-2 window size for decent
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Mon, 24 Sep 2007 15:18:11 +0000 (15:18 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Mon, 24 Sep 2007 15:18:11 +0000 (15:18 +0000)
commit0e443c99edd2dd3bed4d916f1209e71c1629f2e1
tree4ebba2073c9bc838bfb5098c7748c63ae02ac9a5
parent9c0998350a44539ab4f53beeb135aa0051924386
Add support for automatically tuning the SSH-2 window size for decent
performance.  The theory behind this is fairly simple, though the
implementation turns out to be a little trickier than it looks.

The basic idea is that when the connection isn't being limited by our ability
to process data, we want to ensure that the window size _as seen by the server_
never drops to zero.  Measuring the server's view of the window size is done
by arranging for it to acknowledge every SSH_MSG_CHANNEL_WINDOW_ADJUST, or
rather an SSH_MSG_CHANNEL_REQUEST sent just before it.  That way we can tell
when it its outgoing data stream it received the window adjustment, and
thus how small the server's view of the window got.

At present, we only ever increase the window size.  In theory, we could
arrange to reduce it again if the server's view of it seemed to be persistently
too large, but my experiments suggest that getting this right will be tricky.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7735 cda61777-01e9-0310-a592-d414129be87e
ssh.c