View | Details | Raw Unified | Return to bug 1306 | Differences between
and this patch

Collapse All | Expand All

(-)channels.c (-4 / +5 lines)
Lines 932-938 channel_pre_x11_open(Channel *c, fd_set Link Here
932
	} else if (ret == -1) {
932
	} else if (ret == -1) {
933
		logit("X11 connection rejected because of wrong authentication.");
933
		logit("X11 connection rejected because of wrong authentication.");
934
		debug2("X11 rejected %d i%d/o%d", c->self, c->istate, c->ostate);
934
		debug2("X11 rejected %d i%d/o%d", c->self, c->istate, c->ostate);
935
		chan_read_failed(c);
935
		chan_read_failed(c, 0);
936
		buffer_clear(&c->input);
936
		buffer_clear(&c->input);
937
		chan_ibuf_empty(c);
937
		chan_ibuf_empty(c);
938
		buffer_clear(&c->output);
938
		buffer_clear(&c->output);
Lines 1472-1485 channel_handle_rfd(Channel *c, fd_set *r Link Here
1472
				c->type = SSH_CHANNEL_INPUT_DRAINING;
1472
				c->type = SSH_CHANNEL_INPUT_DRAINING;
1473
				debug2("channel %d: input draining.", c->self);
1473
				debug2("channel %d: input draining.", c->self);
1474
			} else {
1474
			} else {
1475
				chan_read_failed(c);
1475
				chan_read_failed(c, (errno == EAGAIN &&
1476
				    !(c->isatty && c->detach_close)));
1476
			}
1477
			}
1477
			return -1;
1478
			return -1;
1478
		}
1479
		}
1479
		if (c->input_filter != NULL) {
1480
		if (c->input_filter != NULL) {
1480
			if (c->input_filter(c, buf, len) == -1) {
1481
			if (c->input_filter(c, buf, len) == -1) {
1481
				debug2("channel %d: filter stops", c->self);
1482
				debug2("channel %d: filter stops", c->self);
1482
				chan_read_failed(c);
1483
				chan_read_failed(c, 0);
1483
			}
1484
			}
1484
		} else if (c->datagram) {
1485
		} else if (c->datagram) {
1485
			buffer_put_string(&c->input, buf, len);
1486
			buffer_put_string(&c->input, buf, len);
Lines 1643-1649 channel_handle_ctl(Channel *c, fd_set *r Link Here
1643
				chan_mark_dead(c);
1644
				chan_mark_dead(c);
1644
				return -1;
1645
				return -1;
1645
			} else {
1646
			} else {
1646
				chan_read_failed(c);
1647
				chan_read_failed(c, 0);
1647
				chan_write_failed(c);
1648
				chan_write_failed(c);
1648
			}
1649
			}
1649
			return -1;
1650
			return -1;
(-)channels.h (-1 / +1 lines)
Lines 240-246 void chan_mark_dead(Channel *); Link Here
240
/* channel events */
240
/* channel events */
241
241
242
void	 chan_rcvd_oclose(Channel *);
242
void	 chan_rcvd_oclose(Channel *);
243
void	 chan_read_failed(Channel *);
243
void	 chan_read_failed(Channel *, int);
244
void	 chan_ibuf_empty(Channel *);
244
void	 chan_ibuf_empty(Channel *);
245
245
246
void	 chan_rcvd_ieof(Channel *);
246
void	 chan_rcvd_ieof(Channel *);
(-)nchan.c (-4 / +6 lines)
Lines 133-149 chan_rcvd_oclose1(Channel *c) Link Here
133
	}
133
	}
134
}
134
}
135
void
135
void
136
chan_read_failed(Channel *c)
136
chan_read_failed(Channel *c, int simulated)
137
{
137
{
138
	debug2("channel %d: read failed", c->self);
138
	debug2("channel %d: read failed%s, istate %d", c->self,
139
	    simulated ? " (simulated)" : "", c->istate);
139
	switch (c->istate) {
140
	switch (c->istate) {
140
	case CHAN_INPUT_OPEN:
141
	case CHAN_INPUT_OPEN:
141
		chan_shutdown_read(c);
142
		chan_shutdown_read(c);
142
		chan_set_istate(c, CHAN_INPUT_WAIT_DRAIN);
143
		chan_set_istate(c, CHAN_INPUT_WAIT_DRAIN);
143
		break;
144
		break;
144
	default:
145
	default:
145
		error("channel %d: chan_read_failed for istate %d",
146
		if (!simulated)
146
		    c->self, c->istate);
147
			error("channel %d: chan_read_failed for istate %d",
148
			    c->self, c->istate);
147
		break;
149
		break;
148
	}
150
	}
149
}
151
}

Return to bug 1306