]> andersk Git - openssh.git/blobdiff - nchan.c
- markus@cvs.openbsd.org 2001/11/07 22:53:21
[openssh.git] / nchan.c
diff --git a/nchan.c b/nchan.c
index 91c34dec89bb68da63a85287e7fe030917cccbeb..2680f0a680bf51a1365cf0c785e73e2b34f38878 100644 (file)
--- a/nchan.c
+++ b/nchan.c
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: nchan.c,v 1.31 2001/07/17 21:04:57 markus Exp $");
+RCSID("$OpenBSD: nchan.c,v 1.32 2001/10/10 22:18:47 markus Exp $");
 
 #include "ssh1.h"
 #include "ssh2.h"
@@ -432,7 +432,7 @@ chan_mark_dead(Channel *c)
 }
 
 int
-chan_is_dead(Channel *c)
+chan_is_dead(Channel *c, int send)
 {
        if (c->type == SSH_CHANNEL_ZOMBIE) {
                debug("channel %d: zombie", c->self);
@@ -461,7 +461,16 @@ chan_is_dead(Channel *c)
                       "read": "write");
        } else {
                if (!(c->flags & CHAN_CLOSE_SENT)) {
-                       chan_send_close2(c);
+                       if (send) {
+                               chan_send_close2(c);
+                       } else {
+                               /* channel would be dead if we sent a close */
+                               if (c->flags & CHAN_CLOSE_RCVD) {
+                                       debug("channel %d: almost dead",
+                                           c->self);
+                                       return 1;
+                               }
+                       }
                }
                if ((c->flags & CHAN_CLOSE_SENT) &&
                    (c->flags & CHAN_CLOSE_RCVD)) {
This page took 0.033158 seconds and 4 git commands to generate.