[master] 8bfe8e0 Fix the last oc->oh tests to look at OC_F_PRIVATE instead

Poul-Henning Kamp phk at varnish-cache.org
Tue Sep 3 10:16:46 CEST 2013


commit 8bfe8e0da21c65d477f8c1ba9f5071b8b3cca149
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Sep 3 08:16:24 2013 +0000

    Fix the last oc->oh tests to look at OC_F_PRIVATE instead

diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index cb22c54..0920b7e 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -168,7 +168,7 @@ VBO_DerefBusyObj(struct worker *wrk, struct busyobj **pbo)
 	*pbo = NULL;
 	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
 	CHECK_OBJ_ORNULL(bo->fetch_obj, OBJECT_MAGIC);
-	if (bo->fetch_obj != NULL && bo->fetch_obj->objcore->objhead != NULL) {
+	if (bo->fetch_obj != NULL) {
 		oc = bo->fetch_obj->objcore;
 		CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
 		CHECK_OBJ_NOTNULL(oc->objhead, OBJHEAD_MAGIC);
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index d928603..441ce2a 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -197,8 +197,8 @@ vbf_stp_fetchhdr(struct worker *wrk, struct busyobj *bo)
 	bo->exp.entered = W_TIM_real(wrk);
 	RFC2616_Ttl(bo);
 
-	/* pass from vclrecv{} has negative TTL */
-	if (bo->fetch_objcore->objhead == NULL)
+	/* private objects have negative TTL */
+	if (bo->fetch_objcore->flags & OC_F_PRIVATE)
 		bo->exp.ttl = -1.;
 
 	AZ(bo->do_esi);
@@ -299,7 +299,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 	else if (bo->is_gzip)
 		bo->vfp = &vfp_testgzip;
 
-	if (bo->fetch_objcore->objhead == NULL)
+	if (bo->fetch_objcore->flags & OC_F_PRIVATE)
 		AN(bo->uncacheable);
 
 	/* No reason to try streaming a non-existing body */
@@ -310,7 +310,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 	    bo->uncacheable ? HTTPH_R_PASS : HTTPH_A_INS, &nhttp);
 
 	/* Create Vary instructions */
-	if (bo->fetch_objcore->objhead != NULL) {
+	if (!(bo->fetch_objcore->flags & OC_F_PRIVATE)) {
 		varyl = VRY_Create(bo, &vary);
 		if (varyl > 0) {
 			AN(vary);
@@ -423,6 +423,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 	VBO_setstate(bo, BOS_FETCHING);
 
 	V1F_fetch_body(wrk, bo);
+	HSH_Complete(obj->objcore);
 
 	assert(bo->refcount >= 1);
 
diff --git a/bin/varnishd/cache/cache_http1_fetch.c b/bin/varnishd/cache/cache_http1_fetch.c
index 2d9928c..01511e8 100644
--- a/bin/varnishd/cache/cache_http1_fetch.c
+++ b/bin/varnishd/cache/cache_http1_fetch.c
@@ -447,7 +447,5 @@ V1F_fetch_body(struct worker *wrk, struct busyobj *bo)
 			    "Content-Length: %zd", obj->len);
 		}
 	}
-	if (obj->objcore->objhead != NULL)
-		HSH_Complete(obj->objcore);
 	bo->stats = NULL;
 }
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 29ae0e4..d66c3de 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -206,7 +206,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
 	}
 
 	req->t_resp = W_TIM_real(wrk);
-	if (req->obj->objcore->objhead != NULL) {
+	if (!(req->obj->objcore->flags & OC_F_PRIVATE)) {
 		if ((req->t_resp - req->obj->last_lru) >
 		    cache_param->lru_timeout &&
 		    EXP_Touch(req->obj->objcore))



More information about the varnish-commit mailing list