debug("channel %d: INPUT_WAIT_DRAIN -> INPUT_WAIT_OCLOSE [inbuf empty, send OCLOSE]", c->self);
debug("channel %d: INPUT_WAIT_DRAIN -> INPUT_WAIT_OCLOSE [inbuf empty, send IEOF]", c->self);
chan_ibuf_empty(Channel *c){	if(buffer_len(&c->input)){		debug("internal error: chan_ibuf_empty %d for non empty buffer",c->self);		return;	}	switch(c->istate){	case CHAN_INPUT_WAIT_DRAIN:		debug("channel %d: INPUT_WAIT_DRAIN -> INPUT_WAIT_OCLOSE [inbuf empty, send OCLOSE]", c->self);		chan_send_ieof(c);		c->istate=CHAN_INPUT_WAIT_OCLOSE;		break;	default:		debug("internal error: chan_ibuf_empty %d for istate %d",c->self,c->istate);		break;	}}