[master] 5800cf9 Add a band-aid for now, and pass the bo with the req where bereq/beresp are available.

Poul-Henning Kamp phk at varnish-cache.org
Mon Apr 22 12:36:07 CEST 2013


commit 5800cf91104795200f6d242b0c3df099b0d6e5fe
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Apr 22 10:35:38 2013 +0000

    Add a band-aid for now, and pass the bo with the req where bereq/beresp
    are available.

diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index de40572..43ecc7c 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -380,11 +380,21 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
 		CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
 		vsl = bo->vsl;
 	}
+	if (method == VCL_MET_BACKEND_FETCH ||
+	    method == VCL_MET_PASS ||
+	    method == VCL_MET_MISS ||
+	    method == VCL_MET_PIPE ||
+	    method == VCL_MET_BACKEND_RESPONSE) {
+		/* XXX: temporary workaround */
+		AN(req);
+		bo = req->busyobj;
+		CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
+	}
 	aws = WS_Snapshot(wrk->aws);
 	wrk->handling = 0;
 	wrk->cur_method = method;
 	VSLb(vsl, SLT_VCL_call, "%s", VCL_Method_Name(method));
-	(void)func(wrk, req, NULL, ws);
+	(void)func(wrk, req, bo, ws);
 	VSLb(vsl, SLT_VCL_return, "%s", VCL_Return_Name(wrk->handling));
 	wrk->cur_method = 0;
 	WS_Reset(wrk->aws, aws);



More information about the varnish-commit mailing list