[master] 255fe95 Change args to http_FilterReq() to a lower level.

Poul-Henning Kamp phk at varnish-cache.org
Mon May 13 11:08:46 CEST 2013


commit 255fe9517fe968be78fb2fe2ed58f0cf93b1c512
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon May 13 09:08:15 2013 +0000

    Change args to http_FilterReq() to a lower level.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 865b315..a28bf98 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -856,7 +856,7 @@ void HTTP_Init(void);
 void http_ClrHeader(struct http *to);
 void http_SetResp(struct http *to, const char *proto, uint16_t status,
     const char *response);
-void http_FilterReq(const struct req *, unsigned how);
+void http_FilterReq(struct http *to, const struct http *fm, unsigned how);
 void http_FilterResp(const struct http *fm, struct http *to, unsigned how);
 void http_PutProtocol(const struct http *to, const char *protocol);
 void http_PutStatus(struct http *to, uint16_t status);
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 3970e63..0066c5c 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -772,27 +772,27 @@ cnt_lookup(struct worker *wrk, struct req *req)
 
 	switch (lr) {
 	case HSH_EXP:
-VSLb(req->vsl, SLT_Debug, "XXXX EXP\n");
+		VSLb(req->vsl, SLT_Debug, "XXXX EXP\n");
 		AN(oc);
 		AZ(boc);
 		break;
 	case HSH_EXPBUSY:
-VSLb(req->vsl, SLT_Debug, "XXXX EXPBUSY\n");
+		VSLb(req->vsl, SLT_Debug, "XXXX EXPBUSY\n");
 		AN(oc);
 		AN(boc);
 		if (VDI_Healthy(req->director, req->digest)) {
-VSLb(req->vsl, SLT_Debug, "deref oc\n");
+			VSLb(req->vsl, SLT_Debug, "XXX EXPBUSY deref oc\n");
 			(void)HSH_Deref(&wrk->stats, oc, NULL);
 			oc = boc;
 			boc = NULL;
 		} else {
-VSLb(req->vsl, SLT_Debug, "drop boc\n");
+			VSLb(req->vsl, SLT_Debug, "XXX EXPBUSY drop boc\n");
 			(void)HSH_Deref(&wrk->stats, boc, NULL);
 			boc = NULL;
 		}
 		break;
 	case HSH_MISS:
-VSLb(req->vsl, SLT_Debug, "XXXX MISS\n");
+		VSLb(req->vsl, SLT_Debug, "XXXX MISS\n");
 		AZ(oc);
 		AN(boc);
 		oc = boc;
@@ -800,7 +800,7 @@ VSLb(req->vsl, SLT_Debug, "XXXX MISS\n");
 		AN(oc->flags & OC_F_BUSY);
 		break;
 	case HSH_HIT:
-VSLb(req->vsl, SLT_Debug, "XXXX HIT\n");
+		VSLb(req->vsl, SLT_Debug, "XXXX HIT\n");
 		AN(oc);
 		AZ(boc);
 		break;
@@ -913,7 +913,9 @@ cnt_miss(struct worker *wrk, struct req *req)
 	AZ(req->obj);
 
 	HTTP_Setup(bo->bereq, bo->ws, bo->vsl, HTTP_Bereq);
-	http_FilterReq(req, HTTPH_R_FETCH);
+	http_FilterReq(bo->bereq, req->http, HTTPH_R_FETCH);
+	http_PrintfHeader(bo->bereq,
+	    "X-Varnish: %u", req->vsl->wid & VSL_IDENTMASK);
 	http_ForceGet(bo->bereq);
 	if (cache_param->http_gzip_support) {
 		/*
@@ -988,7 +990,9 @@ cnt_pass(struct worker *wrk, struct req *req)
 	bo = req->busyobj;
 	bo->refcount = 2;
 	HTTP_Setup(bo->bereq, bo->ws, bo->vsl, HTTP_Bereq);
-	http_FilterReq(req, HTTPH_R_PASS);
+	http_FilterReq(bo->bereq, req->http, HTTPH_R_PASS);
+	http_PrintfHeader(bo->bereq,
+	    "X-Varnish: %u", req->vsl->wid & VSL_IDENTMASK);
 
 	VCL_backend_fetch_method(bo->vcl, wrk, NULL, bo, bo->bereq->ws);
 	VCL_pass_method(bo->vcl, wrk, req, bo, bo->bereq->ws);
@@ -1047,7 +1051,9 @@ cnt_pipe(struct worker *wrk, struct req *req)
 	req->busyobj = VBO_GetBusyObj(wrk, req);
 	bo = req->busyobj;
 	HTTP_Setup(bo->bereq, bo->ws, bo->vsl, HTTP_Bereq);
-	http_FilterReq(req, 0);
+	http_FilterReq(bo->bereq, req->http, 0);	// XXX: 0 ?
+	http_PrintfHeader(bo->bereq,
+	    "X-Varnish: %u", req->vsl->wid & VSL_IDENTMASK);
 
 	VCL_pipe_method(req->vcl, wrk, req, NULL, req->http->ws);
 



More information about the varnish-commit mailing list