Commit 0bde32eb authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Remove the unnecessary third argument to VBE_ClosedFd() and remove

a couple of now pointless debugging messages in pipe mode.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1889 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 7c59526f
......@@ -366,7 +366,7 @@ extern int vca_pipes[2];
/* cache_backend.c */
void VBE_Init(void);
struct vbe_conn *VBE_GetFd(struct sess *sp);
void VBE_ClosedFd(struct worker *w, struct vbe_conn *vc, int already);
void VBE_ClosedFd(struct worker *w, struct vbe_conn *vc);
void VBE_RecycleFd(struct worker *w, struct vbe_conn *vc);
struct bereq * VBE_new_bereq(void);
void VBE_free_bereq(struct bereq *bereq);
......
......@@ -290,7 +290,7 @@ vbe_nextfd(struct sess *sp)
reuse = 1;
break;
}
VBE_ClosedFd(sp->wrk, vc, 0);
VBE_ClosedFd(sp->wrk, vc);
}
if (vc == NULL) {
......@@ -352,15 +352,14 @@ VBE_GetFd(struct sess *sp)
/* Close a connection ------------------------------------------------*/
void
VBE_ClosedFd(struct worker *w, struct vbe_conn *vc, int already)
VBE_ClosedFd(struct worker *w, struct vbe_conn *vc)
{
CHECK_OBJ_NOTNULL(vc, VBE_CONN_MAGIC);
assert(vc->fd >= 0);
AN(vc->backend);
WSL(w, SLT_BackendClose, vc->fd, "%s", vc->backend->vcl_name);
if (!already)
AZ(close(vc->fd));
AZ(close(vc->fd));
vc->fd = -1;
vc->backend = NULL;
LOCK(&vbemtx);
......
......@@ -346,7 +346,7 @@ Fetch(struct sess *sp)
TAILQ_REMOVE(&sp->obj->store, st, list);
STV_free(st);
}
VBE_ClosedFd(sp->wrk, vc, 0);
VBE_ClosedFd(sp->wrk, vc);
return (-1);
}
......@@ -364,7 +364,7 @@ Fetch(struct sess *sp)
cls = 1;
if (cls)
VBE_ClosedFd(sp->wrk, vc, 0);
VBE_ClosedFd(sp->wrk, vc);
else
VBE_RecycleFd(sp->wrk, vc);
......
......@@ -50,8 +50,6 @@ rdf(struct pollfd *fds, int idx)
i = read(fds[idx].fd, buf, sizeof buf);
if (i <= 0 || fds[1-idx].events == 0) {
VSL(SLT_Debug, fds[idx].fd, "Pipe Shut read(read)");
VSL(SLT_Debug, fds[1-idx].fd, "Pipe Shut write(read)");
shutdown(fds[idx].fd, SHUT_RD);
shutdown(fds[1-idx].fd, SHUT_WR);
fds[idx].events = 0;
......@@ -59,9 +57,7 @@ rdf(struct pollfd *fds, int idx)
}
for (p = buf; i > 0; i -= j, p += j) {
j = write(fds[1-idx].fd, p, i);
if (j < 0) {
VSL(SLT_Debug, fds[idx].fd, "Pipe Shut write(write)");
VSL(SLT_Debug, fds[1-idx].fd, "Pipe Shut read(write)");
if (j != i) {
shutdown(fds[idx].fd, SHUT_WR);
shutdown(fds[1-idx].fd, SHUT_RD);
fds[1-idx].events = 0;
......@@ -98,7 +94,7 @@ PipeSession(struct sess *sp)
if (WRK_Flush(w)) {
vca_close_session(sp, "pipe");
VBE_ClosedFd(sp->wrk, vc, 0);
VBE_ClosedFd(sp->wrk, vc);
return;
}
......@@ -125,6 +121,5 @@ PipeSession(struct sess *sp)
rdf(fds, 1);
}
vca_close_session(sp, "pipe");
(void)close (vc->fd);
VBE_ClosedFd(sp->wrk, vc, 1);
VBE_ClosedFd(sp->wrk, vc);
}
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