Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
Merged revisions 1889 via svnmerge from
Browse files Browse the repository at this point in the history
svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache

........
  r1889 | phk | 2007-08-20 13:05:48 +0200 (Mon, 20 Aug 2007) | 3 lines
  
  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/branches/1.1@2147 d4fa192b-c00b-0410-8231-f00ffab90ce4
  • Loading branch information
dag-erling committed Oct 19, 2007
1 parent 70d4b4b commit 27ed5d2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bin/varnishd/cache.h
Expand Up @@ -368,7 +368,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);
Expand Down
7 changes: 3 additions & 4 deletions bin/varnishd/cache_backend.c
Expand Up @@ -284,7 +284,7 @@ vbe_nextfd(struct sess *sp)
reuse = 1;
break;
}
VBE_ClosedFd(sp->wrk, vc, 0);
VBE_ClosedFd(sp->wrk, vc);
}

if (vc == NULL) {
Expand Down Expand Up @@ -346,15 +346,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);
Expand Down
6 changes: 3 additions & 3 deletions bin/varnishd/cache_fetch.c
Expand Up @@ -341,7 +341,7 @@ Fetch(struct sess *sp)
} else if (http_GetHdr(hp, H_Transfer_Encoding, &b)) {
/* XXX: AUGH! */
VSL(SLT_Debug, vc->fd, "Invalid Transfer-Encoding");
VBE_ClosedFd(sp->wrk, vc, 0);
VBE_ClosedFd(sp->wrk, vc);
return (-1);
} else if (strcmp(http_GetProto(hp), "HTTP/1.1")) {
switch (http_GetStatus(hp)) {
Expand All @@ -364,7 +364,7 @@ Fetch(struct sess *sp)
VTAILQ_REMOVE(&sp->obj->store, st, list);
STV_free(st);
}
VBE_ClosedFd(sp->wrk, vc, 0);
VBE_ClosedFd(sp->wrk, vc);
return (-1);
}

Expand All @@ -382,7 +382,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);

Expand Down
11 changes: 3 additions & 8 deletions bin/varnishd/cache_pipe.c
Expand Up @@ -50,18 +50,14 @@ 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;
return;
}
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;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
}

0 comments on commit 27ed5d2

Please sign in to comment.