Commit 78acd755 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Close gracefully in pipe mode


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@374 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 21d2e3bc
......@@ -37,7 +37,11 @@ rdf(int fd, short event, void *arg)
event_del(&ep->ev);
} else {
j = write(ep->fd, buf, i);
assert(i == j);
if (i != j) {
shutdown(fd, SHUT_WR);
shutdown(ep->fd, SHUT_RD);
event_del(&ep->ev);
}
}
}
......@@ -57,7 +61,11 @@ PipeSession(struct worker *w, struct sess *sp)
assert(i == sbuf_len(w->sb));
if (http_GetTail(sp->http, 99999999, &b, &e) && b != e) { /* XXX */
i = write(fd, b, e - b);
assert(i == e - b);
if (i != e - b) {
close (fd);
vca_close_session(sp, "pipe");
VBE_ClosedFd(fd_token);
}
}
e1.fd = fd;
......
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