Apparently sending DISCONNECT on a normal SSH2 connection close is
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 10 Dec 2001 18:12:51 +0000 (18:12 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 10 Dec 2001 18:12:51 +0000 (18:12 +0000)
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

ssh.c

diff --git a/ssh.c b/ssh.c
index bb8441a..fe163c0 100644 (file)
--- 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;
                }