version 1.62, 2008/11/07 18:50:18 |
version 1.63, 2010/01/26 01:28:35 |
|
|
switch (c->istate) { |
switch (c->istate) { |
case CHAN_INPUT_WAIT_DRAIN: |
case CHAN_INPUT_WAIT_DRAIN: |
if (compat20) { |
if (compat20) { |
if (!(c->flags & CHAN_CLOSE_SENT)) |
if (!(c->flags & (CHAN_CLOSE_SENT|CHAN_LOCAL))) |
chan_send_eof2(c); |
chan_send_eof2(c); |
chan_set_istate(c, CHAN_INPUT_CLOSED); |
chan_set_istate(c, CHAN_INPUT_CLOSED); |
} else { |
} else { |
|
|
chan_rcvd_close2(Channel *c) |
chan_rcvd_close2(Channel *c) |
{ |
{ |
debug2("channel %d: rcvd close", c->self); |
debug2("channel %d: rcvd close", c->self); |
if (c->flags & CHAN_CLOSE_RCVD) |
if (!(c->flags & CHAN_LOCAL)) { |
error("channel %d: protocol error: close rcvd twice", c->self); |
if (c->flags & CHAN_CLOSE_RCVD) |
c->flags |= CHAN_CLOSE_RCVD; |
error("channel %d: protocol error: close rcvd twice", |
|
c->self); |
|
c->flags |= CHAN_CLOSE_RCVD; |
|
} |
if (c->type == SSH_CHANNEL_LARVAL) { |
if (c->type == SSH_CHANNEL_LARVAL) { |
/* tear down larval channels immediately */ |
/* tear down larval channels immediately */ |
chan_set_ostate(c, CHAN_OUTPUT_CLOSED); |
chan_set_ostate(c, CHAN_OUTPUT_CLOSED); |
|
|
chan_set_istate(c, CHAN_INPUT_CLOSED); |
chan_set_istate(c, CHAN_INPUT_CLOSED); |
break; |
break; |
case CHAN_INPUT_WAIT_DRAIN: |
case CHAN_INPUT_WAIT_DRAIN: |
chan_send_eof2(c); |
if (!(c->flags & CHAN_LOCAL)) |
|
chan_send_eof2(c); |
chan_set_istate(c, CHAN_INPUT_CLOSED); |
chan_set_istate(c, CHAN_INPUT_CLOSED); |
break; |
break; |
} |
} |
} |
} |
|
|
void |
void |
chan_rcvd_eow(Channel *c) |
chan_rcvd_eow(Channel *c) |
{ |
{ |
|
|
c->self, c->efd, buffer_len(&c->extended)); |
c->self, c->efd, buffer_len(&c->extended)); |
return 0; |
return 0; |
} |
} |
|
if (c->flags & CHAN_LOCAL) { |
|
debug2("channel %d: is dead (local)", c->self); |
|
return 1; |
|
} |
if (!(c->flags & CHAN_CLOSE_SENT)) { |
if (!(c->flags & CHAN_CLOSE_SENT)) { |
if (do_send) { |
if (do_send) { |
chan_send_close2(c); |
chan_send_close2(c); |