only send it when it will significantly increase the server's idea of our
window. This avoids the slew of one-byte WINDOW_ADJUSTs that an interactive
shell typically generates.
git-svn-id: svn://svn.tartarus.org/sgt/putty@5121
cda61777-01e9-0310-a592-
d414129be87e
if (c->closes != 0)
return;
- if (newwin > c->v.v2.locwindow) {
+ /*
+ * Only send a WINDOW_ADJUST if there's significantly more window
+ * available than the other end thinks there is. This saves us
+ * sending a WINDOW_ADJUST for every character in a shell session.
+ *
+ * "Significant" is arbitrarily defined as half the window size.
+ */
+ if (newwin > c->v.v2.locwindow * 2) {
struct Packet *pktout;
pktout = ssh2_pkt_init(SSH2_MSG_CHANNEL_WINDOW_ADJUST);