From: Simon Tatham Date: Fri, 26 Jan 2001 12:22:16 +0000 (+0000) Subject: Ensure all backends _remember_ the connection has closed after X-Git-Tag: r8855-g4f798d~2797 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=f8848be2d87086a2b0b75ea84c2e4a820aceb8f9;p=PuTTY_svn.git Ensure all backends _remember_ the connection has closed after receiving a network error. Should prevent the cascading-error-box bug. git-svn-id: http://svn.tartarus.org/sgt/putty@900 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/raw.c b/raw.c index 2abc0a8d..27af2c4e 100644 --- a/raw.c +++ b/raw.c @@ -24,9 +24,10 @@ static void c_write (char *buf, int len) { from_backend(0, buf, len); } -static int raw_receive (Socket s, int urgent, char *data, int len) { +static int raw_receive (Socket skt, int urgent, char *data, int len) { if (urgent==3) { /* A socket error has occurred. */ + s = NULL; connection_fatal(data); len = 0; } diff --git a/rlogin.c b/rlogin.c index 20296a0b..e0552f25 100644 --- a/rlogin.c +++ b/rlogin.c @@ -24,9 +24,10 @@ static void c_write (char *buf, int len) { from_backend(0, buf, len); } -static int rlogin_receive (Socket s, int urgent, char *data, int len) { +static int rlogin_receive (Socket skt, int urgent, char *data, int len) { if (urgent==3) { /* A socket error has occurred. */ + s = NULL; connection_fatal(data); len = 0; } diff --git a/ssh.c b/ssh.c index 44075a7e..2ef8ac4d 100644 --- a/ssh.c +++ b/ssh.c @@ -1151,6 +1151,8 @@ static void ssh_gotdata(unsigned char *data, int datalen) static int ssh_receive(Socket skt, int urgent, char *data, int len) { if (urgent==3) { /* A socket error has occurred. */ + ssh_state = SSH_STATE_CLOSED; + s = NULL; connection_fatal(data); len = 0; } diff --git a/telnet.c b/telnet.c index 3e65cd41..cd70d9b8 100644 --- a/telnet.c +++ b/telnet.c @@ -465,9 +465,10 @@ static void do_telnet_read (char *buf, int len) { } } -static int telnet_receive(Socket s, int urgent, char *data, int len) { +static int telnet_receive(Socket skt, int urgent, char *data, int len) { if (urgent==3) { /* A socket error has occurred. */ + s = NULL; connection_fatal(data); len = 0; }