[master] 01ccb32 Eliminate a couple of trivial uses of req->obj

Poul-Henning Kamp phk at FreeBSD.org
Tue Aug 5 14:00:12 CEST 2014


commit 01ccb3200d4f9e97b3508c7d5036b247505ca3fa
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Aug 5 11:59:56 2014 +0000

    Eliminate a couple of trivial uses of req->obj

diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index 3266ade..ba145ea 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -264,7 +264,7 @@ ESI_Deliver(struct req *req)
 	int i;
 
 	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
-	p = ObjGetattr(req->obj->objcore, &req->wrk->stats, OA_ESIDATA, &l);
+	p = ObjGetattr(req->objcore, &req->wrk->stats, OA_ESIDATA, &l);
 	AN(p);
 	assert(l > 0);
 	e = p + l;
diff --git a/bin/varnishd/cache/cache_http1_deliver.c b/bin/varnishd/cache/cache_http1_deliver.c
index 73aea69..2817d09 100644
--- a/bin/varnishd/cache/cache_http1_deliver.c
+++ b/bin/varnishd/cache/cache_http1_deliver.c
@@ -235,12 +235,12 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
 	ssize_t l;
 
 	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
-	CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
 	CHECK_OBJ_NOTNULL(req->obj->objcore, OBJCORE_MAGIC);
 
 	req->res_mode = 0;
 
-	if (!req->disable_esi && req->obj->esidata != NULL) {
+	if (!req->disable_esi && ObjGetattr(req->objcore, &req->wrk->stats,
+	    OA_ESIDATA, NULL) != NULL) {
 		/* In ESI mode, we can't know the aggregate length */
 		req->res_mode &= ~RES_LEN;
 		req->res_mode |= RES_ESI;



More information about the varnish-commit mailing list