[master] 4b8bf44 Move the ->getfd() responsibilities a few microns.
Poul-Henning Kamp
phk at FreeBSD.org
Wed Oct 1 12:28:58 CEST 2014
commit 4b8bf44b59ba66ae534990df3adb27f4629ce7d8
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Oct 1 10:28:29 2014 +0000
Move the ->getfd() responsibilities a few microns.
diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 2fbb223..2032787 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -429,6 +429,10 @@ vdi_simple_getfd(const struct director *d, struct busyobj *bo)
FIND_TMO(between_bytes_timeout,
vc->between_bytes_timeout, bo, vs->vrt);
}
+ if (vc != NULL)
+ vc->vsl = bo->vsl;
+ else
+ VSLb(bo->vsl, SLT_FetchError, "no backend connection");
return (vc);
}
@@ -455,7 +459,7 @@ vdi_simple_gethdrs(const struct director *d, struct worker *wrk,
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
- bo->vbc = VDI_GetFd(d, wrk, bo);
+ bo->vbc = vdi_simple_getfd(d, bo);
if (bo->vbc == NULL) {
VSLb(bo->vsl, SLT_FetchError, "no backend connection");
return (-1);
diff --git a/bin/varnishd/cache/cache_dir.c b/bin/varnishd/cache/cache_dir.c
index c58d5a9..9d5b31b 100644
--- a/bin/varnishd/cache/cache_dir.c
+++ b/bin/varnishd/cache/cache_dir.c
@@ -127,7 +127,6 @@ VDI_Finish(const struct director *d, struct worker *wrk, struct busyobj *bo)
struct vbc *
VDI_GetFd(const struct director *d, struct worker *wrk, struct busyobj *bo)
{
- struct vbc *vc;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
@@ -138,10 +137,7 @@ VDI_GetFd(const struct director *d, struct worker *wrk, struct busyobj *bo)
return (NULL);
AN(d->getfd);
- vc = d->getfd(d, bo);
- if (vc != NULL)
- vc->vsl = bo->vsl;
- return (vc);
+ return (d->getfd(d, bo));
}
/* Check health ------------------------------------------------------
diff --git a/bin/varnishd/cache/cache_pipe.c b/bin/varnishd/cache/cache_pipe.c
index 2e2d57d..3d17735 100644
--- a/bin/varnishd/cache/cache_pipe.c
+++ b/bin/varnishd/cache/cache_pipe.c
@@ -115,7 +115,6 @@ PipeRequest(struct req *req, struct busyobj *bo)
vc = VDI_GetFd(bo->director_req, wrk, bo);
if (vc == NULL) {
- VSLb(bo->vsl, SLT_FetchError, "no backend connection");
pipecharge(req, &acct_pipe, NULL);
SES_Close(req->sp, SC_OVERLOAD);
return;
More information about the varnish-commit
mailing list