Commit ef217697 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Quit early if setting blocking mode fails.

Submitted by:	Nils Goroll
parent 09b66bd7
...@@ -1575,14 +1575,21 @@ CNT_Session(struct sess *sp) ...@@ -1575,14 +1575,21 @@ CNT_Session(struct sess *sp)
AZ(w->do_esi); AZ(w->do_esi);
/* /*
* Whenever we come in from the acceptor we need to set blocking * Whenever we come in from the acceptor or waiter, we need to set
* mode, but there is no point in setting it when we come from * blocking mode, but there is no point in setting it when we come from
* ESI or when a parked sessions returns. * ESI or when a parked sessions returns.
* It would be simpler to do this in the acceptor, but we'd rather * It would be simpler to do this in the acceptor or waiter, but we'd
* do the syscall in the worker thread. * rather do the syscall in the worker thread.
* On systems which return errors for ioctl, we close early
*/ */
if (sp->step == STP_FIRST || sp->step == STP_START) if ((sp->step == STP_FIRST || sp->step == STP_START) &&
(void)VTCP_blocking(sp->fd); VTCP_blocking(sp->fd)) {
if (errno == ECONNRESET)
vca_close_session(sp, "remote closed");
else
vca_close_session(sp, "error");
sp->step = STP_DONE;
}
/* /*
* NB: Once done is set, we can no longer touch sp! * NB: Once done is set, we can no longer touch sp!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment