Commit 04fd83f2 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Merge r5082: Fix a pipe mode corner case

Fix a corner-case of pipe mode close-down processing, by simplifying
the logic and letting vca_close_session() and VBE_CloseFd() carry out
the last rites.

Closes: #746


git-svn-id: http://www.varnish-cache.org/svn/branches/2.1@5306 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent c4b4a22a
......@@ -115,26 +115,22 @@ PipeSession(struct sess *sp)
if (i < 1)
break;
if (fds[0].revents && rdf(vc->fd, sp->fd)) {
if (fds[1].fd == -1)
break;
(void)shutdown(vc->fd, SHUT_RD);
(void)shutdown(sp->fd, SHUT_WR);
fds[0].events = 0;
fds[0].fd = -1;
}
if (fds[1].revents && rdf(sp->fd, vc->fd)) {
if (fds[0].fd == -1)
break;
(void)shutdown(sp->fd, SHUT_RD);
(void)shutdown(vc->fd, SHUT_WR);
fds[1].events = 0;
fds[1].fd = -1;
}
}
if (fds[0].fd >= 0) {
(void)shutdown(vc->fd, SHUT_RD);
(void)shutdown(sp->fd, SHUT_WR);
}
if (fds[1].fd >= 0) {
(void)shutdown(sp->fd, SHUT_RD);
(void)shutdown(vc->fd, SHUT_WR);
}
vca_close_session(sp, "pipe");
VBE_CloseFd(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