version 1.31, 2001/07/17 21:04:57 |
version 1.32, 2001/10/10 22:18:47 |
|
|
} |
} |
|
|
int |
int |
chan_is_dead(Channel *c) |
chan_is_dead(Channel *c, int send) |
{ |
{ |
if (c->type == SSH_CHANNEL_ZOMBIE) { |
if (c->type == SSH_CHANNEL_ZOMBIE) { |
debug("channel %d: zombie", c->self); |
debug("channel %d: zombie", c->self); |
|
|
"read": "write"); |
"read": "write"); |
} else { |
} else { |
if (!(c->flags & CHAN_CLOSE_SENT)) { |
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) && |
if ((c->flags & CHAN_CLOSE_SENT) && |
(c->flags & CHAN_CLOSE_RCVD)) { |
(c->flags & CHAN_CLOSE_RCVD)) { |