]> andersk Git - openssh.git/blobdiff - mux.c
- djm@cvs.openbsd.org 2010/01/30 02:54:53
[openssh.git] / mux.c
diff --git a/mux.c b/mux.c
index dcd6dc02855bedc0b79876b57bb2675519751e36..825fb7a9a70d648333190ad5b4457888f5ef7832 100644 (file)
--- a/mux.c
+++ b/mux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mux.c,v 1.10 2010/01/26 01:28:35 djm Exp $ */
+/* $OpenBSD: mux.c,v 1.14 2010/01/30 02:54:53 djm Exp $ */
 /*
  * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
  *
@@ -210,7 +210,15 @@ mux_master_control_cleanup_cb(int cid, void *unused)
                            __func__, c->self, c->remote_id);
                c->remote_id = -1;
                sc->ctl_chan = -1;
-               chan_mark_dead(sc);
+               if (sc->type != SSH_CHANNEL_OPEN) {
+                       debug2("%s: channel %d: not open", __func__, sc->self);
+                       chan_mark_dead(sc);
+               } else {
+                       if (sc->istate == CHAN_INPUT_OPEN)
+                               chan_read_failed(sc);
+                       if (sc->ostate == CHAN_OUTPUT_OPEN)
+                               chan_write_failed(sc);
+               }
        }
        channel_cancel_cleanup(c->self);
 }
This page took 0.090871 seconds and 4 git commands to generate.