if (c->type != SSH_CHANNEL_OPEN) { debug("channel %d: non-open", c->self); if (c->istate == CHAN_INPUT_OPEN) { debug("channel %d: non-open: input open -> wait_oclose", c->self); chan_shutdown_read(c); chan_send_ieof1(c); c->istate = CHAN_INPUT_WAIT_OCLOSE; } else { error("channel %d: istate %d != open", c->self, c->istate); } if (c->ostate == CHAN_OUTPUT_OPEN) { debug("channel %d: non-open: output open -> closed", c->self); chan_send_oclose1(c); c->ostate = CHAN_OUTPUT_CLOSED; } else { error("channel %d: ostate %d != open", c->self, c->ostate); } return; }
chan_rcvd_ieof1(Channel *c){	debug("channel %d: rcvd ieof", c->self);	switch (c->ostate) {	case CHAN_OUTPUT_OPEN:		debug("channel %d: output open -> drain", c->self);		c->ostate = CHAN_OUTPUT_WAIT_DRAIN;		break;	case CHAN_OUTPUT_WAIT_IEOF:		debug("channel %d: output wait_ieof -> closed", c->self);		c->ostate = CHAN_OUTPUT_CLOSED;		break;	default:		error("channel %d: protocol error: chan_rcvd_ieof for ostate %d",		    c->self, c->ostate);		break;	}}