From 2c42b7256c8970f1df8588b37219812d88eac0f5 Mon Sep 17 00:00:00 2001 From: jacob Date: Tue, 14 Jun 2005 14:48:17 +0000 Subject: [PATCH] We should wait until the Rlogin server indicates that it's happy to receive window-size notifications before we send them. This clears up a problem where the first password entry always failed. git-svn-id: svn://svn.tartarus.org/sgt/putty@5960 cda61777-01e9-0310-a592-d414129be87e --- rlogin.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rlogin.c b/rlogin.c index a6dad0e4..2d2b288a 100644 --- a/rlogin.c +++ b/rlogin.c @@ -20,6 +20,7 @@ typedef struct rlogin_tag { Socket s; int bufsize; int firstbyte; + int cansize; int term_width, term_height; void *frontend; } *Rlogin; @@ -73,8 +74,10 @@ static int rlogin_receive(Plug plug, int urgent, char *data, int len) c = *data++; len--; - if (c == '\x80') + if (c == '\x80') { + rlogin->cansize = 1; rlogin_size(rlogin, rlogin->term_width, rlogin->term_height); + } /* * We should flush everything (aka Telnet SYNCH) if we see * 0x02, and we should turn off and on _local_ flow control @@ -136,6 +139,7 @@ static const char *rlogin_init(void *frontend_handle, void **backend_handle, rlogin->term_width = cfg->width; rlogin->term_height = cfg->height; rlogin->firstbyte = 1; + rlogin->cansize = 0; *backend_handle = rlogin; /* @@ -243,7 +247,7 @@ static void rlogin_size(void *handle, int width, int height) rlogin->term_width = width; rlogin->term_height = height; - if (rlogin->s == NULL) + if (rlogin->s == NULL || !rlogin->cansize) return; b[6] = rlogin->term_width >> 8; -- 2.11.0