[master] 67d1592 Have the busyobj hold a ref on the clients session, so we can get at client/server IPs.
Poul-Henning Kamp
phk at FreeBSD.org
Thu Apr 7 10:51:04 CEST 2016
commit 67d15920302f4bf7486193ada259f1966853e3b3
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Apr 7 08:46:35 2016 +0000
Have the busyobj hold a ref on the clients session, so we can get
at client/server IPs.
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index eef6d8b..77f62e1 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -472,6 +472,7 @@ struct busyobj {
*/
int retries;
struct req *req;
+ struct sess *sp;
struct worker *wrk;
struct vfp_ctx vfc[1];
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index fb7c638..8a513f2 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -989,6 +989,7 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
wrk->vsl = NULL;
HSH_DerefBoc(wrk, bo->fetch_objcore);
+ SES_Rel(bo->sp);
VBO_ReleaseBusyObj(wrk, &bo);
THR_SetBusyobj(NULL);
}
@@ -1029,6 +1030,8 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
THR_SetBusyobj(bo);
+ bo->sp = req->sp;
+ SES_Ref(bo->sp);
AN(bo->vcl);
@@ -1061,6 +1064,8 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
if (bo->stale_oc != NULL)
(void)HSH_DerefObjCore(wrk, &bo->stale_oc);
HSH_DerefBoc(wrk, oc);
+ SES_Rel(bo->sp);
+ VBO_ReleaseBusyObj(wrk, &bo);
} else {
bo = NULL; /* ref transferred to fetch thread */
if (mode == VBF_BACKGROUND) {
More information about the varnish-commit
mailing list