Ted Unangst <[email protected]> writes:

> Whenever I change IPs or networks or whatever, I usually forget an
> open ssh session somewhere, which then stalls and I can't disconnect it.
>
> No big deal, right?  Hit enter a few times, then ~., and I should
> disconnect.  Except I don't.  Just hangs there waiting around for
> some slow network timeout.  Why?  It seems the time when using ~. to
> disconnect would be most useful is when the network is down, and
> that's precisely when it doesn't work.
>

I have this hack: 

--- clientloop.c        20 Jun 2012 04:42:58 -0000      1.240
+++ clientloop.c        2 Aug 2012 19:35:07 -0000
@@ -1029,18 +1029,7 @@
                        /* Process the escaped character. */
                        switch (ch) {
                        case '.':
-                               /* Terminate the connection. */
-                               snprintf(string, sizeof string, "%c.\r\n",
-                                   escape_char);
-                               buffer_append(berr, string, strlen(string));
-
-                               if (c && c->ctl_chan != -1) {
-                                       chan_read_failed(c);
-                                       chan_write_failed(c);
-                                       return 0;
-                               } else
-                                       quit_pending = 1;
-                               return -1;
+                               cleanup_exit(0);
 
                        case 'Z' - 64:
                                /* XXX support this for mux clients */

Reply via email to