From: simon Date: Mon, 10 Dec 2001 18:12:51 +0000 (+0000) Subject: Apparently sending DISCONNECT on a normal SSH2 connection close is X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/ca2914d11e55cda342e3c1a25ffbe68b4b6cb653 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@1468 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/ssh.c b/ssh.c index bb8441af..fe163c0b 100644 --- a/ssh.c +++ b/ssh.c @@ -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; }