[master] b094d58 Give the busyobj a copy (+ref) of the req's vcl and director.

Poul-Henning Kamp phk at varnish-cache.org
Mon Apr 29 14:45:52 CEST 2013


commit b094d583d10a696022e095345f58260f06f602b8
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Apr 29 12:45:25 2013 +0000

    Give the busyobj a copy (+ref) of the req's vcl and director.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index b15eaba..50128ce 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -539,6 +539,8 @@ struct busyobj {
 	double			between_bytes_timeout;
 
 	const char		*storage_hint;
+	struct director		*director;
+	struct VCL_conf		*vcl;
 
 	struct vsl_log		vsl[1];
 	struct dstat		*stats;
diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index 9131cd0..ffe108a 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -141,6 +141,10 @@ VBO_GetBusyObj(struct worker *wrk, struct req *req)
 
 	bo->do_stream = 1;
 
+	bo->director = req->director;
+	bo->vcl = req->vcl;
+	VCL_Ref(bo->vcl);
+
 	return (bo);
 }
 
@@ -183,6 +187,8 @@ VBO_DerefBusyObj(struct worker *wrk, struct busyobj **pbo)
 		(void)HSH_Deref(&wrk->stats, NULL, &bo->fetch_obj);
 	}
 
+	VCL_Rel(&bo->vcl);
+
 	memset(&bo->refcount, 0,
 	    sizeof *bo - offsetof(struct busyobj, refcount));
 



More information about the varnish-commit mailing list