1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Apparently sending DISCONNECT on a normal SSH2 connection close is

actually _less_ polite than just closing the connection, rather than
more polite as I'd believed. So we now just close.

[originally from svn r1468]
This commit is contained in:
Simon Tatham 2001-12-10 18:12:51 +00:00
parent 3c24104a7d
commit 46f2897cf6

13
ssh.c
View File

@ -4864,12 +4864,25 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
* See if that was the last channel left open.
*/
if (count234(ssh_channels) == 0) {
#if 0
/*
* We used to send SSH_MSG_DISCONNECT here,
* because I'd believed that _every_ conforming
* SSH2 connection had to end with a disconnect
* being sent by at least one side; apparently
* I was wrong and it's perfectly OK to
* unceremoniously slam the connection shut
* when you're done, and indeed OpenSSH feels
* this is more polite than sending a
* DISCONNECT. So now we don't.
*/
logevent("All channels closed. Disconnecting");
ssh2_pkt_init(SSH2_MSG_DISCONNECT);
ssh2_pkt_adduint32(SSH2_DISCONNECT_BY_APPLICATION);
ssh2_pkt_addstring("All open channels closed");
ssh2_pkt_addstring("en"); /* language tag */
ssh2_pkt_send();
#endif
ssh_state = SSH_STATE_CLOSED;
crReturnV;
}