[experimental-ims] 51ee983 Bugfixes for merge master -> experimental-ims to pass varnishtest

Geoff Simmons geoff at varnish-cache.org
Tue Jan 10 00:03:35 CET 2012


commit 51ee983341dbac603510cdf657fa31d8476fdc19
Author: Geoff Simmons <geoff at uplex.de>
Date:   Tue Jan 10 00:01:50 2012 +0100

    Bugfixes for merge master -> experimental-ims to pass varnishtest

diff --git a/bin/varnishd/cache/cache_center.c b/bin/varnishd/cache/cache_center.c
index 22430ca..1883943 100644
--- a/bin/varnishd/cache/cache_center.c
+++ b/bin/varnishd/cache/cache_center.c
@@ -858,7 +858,7 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
 	}
 	CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
 
-	wrk->busyobj->exp.keep = sp->exp.keep;
+	wrk->busyobj->exp.keep = req->exp.keep;
 
 	req->storage_hint = NULL;
 
@@ -897,7 +897,7 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
         if (sp->stale_obj) {
             http_Check304(sp);
             if (wrk->busyobj->beresp->status == 304)
-                assert(wrk->obj->http->status == 200);
+                assert(req->obj->http->status == 200);
 	    EXP_Clr(&sp->stale_obj->exp);
 	    EXP_Rearm(sp->stale_obj);
 	    HSH_Deref(sp->wrk, NULL, &sp->stale_obj);
@@ -906,8 +906,8 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
 	http_CopyHome(wrk, sp->vsl_id, hp2);
 
 	if (http_GetHdr(hp, H_Last_Modified, &b)
-            || http_GetHdr(wrk->obj->http, H_Last_Modified, &b))
-		wrk->obj->last_modified = VTIM_parse(b);
+            || http_GetHdr(req->obj->http, H_Last_Modified, &b))
+		req->obj->last_modified = VTIM_parse(b);
 	else
 		req->obj->last_modified = floor(wrk->busyobj->exp.entered);
 
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 75f568c..6ae193d 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -472,7 +472,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
 
         /* If we're not serving a valid or graced object and we saved stale_o,
 	 * it is a candidate for the conditional backend request. */
-        AZ(oc && !sp->hash_always_miss);
+        AZ(oc && !sp->req->hash_always_miss);
         AZ(busy_oc);
         if (stale_o != NULL) {
                 AZ(stale_o->objcore->flags & OC_F_BUSY);
diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index ef7bbc5..4f48d52 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -959,7 +959,7 @@ http_Check304(struct sess *sp)
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 	o_stale = sp->stale_obj;
 	CHECK_OBJ_NOTNULL(o_stale, OBJECT_MAGIC);
-	o = sp->wrk->obj;
+	o = sp->req->obj;
 	CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
 
 	if (sp->wrk->busyobj->beresp->status != 304) {
@@ -984,7 +984,8 @@ http_Check304(struct sess *sp)
 	 */
 	STV_dup(sp, o_stale, o);
 	http_Unset(o->http, H_Content_Length);
-	http_PrintfHeader(sp->wrk, sp->fd, o->http, "Content-Length: %u", o->len);
+	http_PrintfHeader(sp->wrk, sp->fd, o->http, "Content-Length: %u",
+	    o->len);
 
 	http_SetResp(o->http, "HTTP/1.1", 200, "Ok Not Modified");
 	http_SetH(o->http, HTTP_HDR_REQ, "GET");
diff --git a/bin/varnishd/storage/stevedore.c b/bin/varnishd/storage/stevedore.c
index 432a5b2..150a142 100644
--- a/bin/varnishd/storage/stevedore.c
+++ b/bin/varnishd/storage/stevedore.c
@@ -378,7 +378,7 @@ STV_alloc(struct worker *w, size_t size)
 {
 	struct object *obj = w->busyobj->fetch_obj;
 	if (obj == NULL)
-		obj = w->obj;
+		obj = w->sp->req->obj;
 
 	return (stv_alloc(w, obj, size));
 }
diff --git a/bin/varnishtest/tests/i00000.vtc b/bin/varnishtest/tests/i00000.vtc
index 4c4aeb5..d274f95 100644
--- a/bin/varnishtest/tests/i00000.vtc
+++ b/bin/varnishtest/tests/i00000.vtc
@@ -491,8 +491,7 @@ varnish v1 -badvcl {
 
 varnish v1 -cliok "param.show default_keep"
 
-varnish v1 -cliok "param.set default_keep 30s"
+varnish v1 -cliok "param.set default_keep 30"
 
-## XXX: This is not caught as an error
-#varnish v1 -clierr 106 "param.set default_keep foo"
+varnish v1 -clierr 106 "param.set default_keep foo"
 



More information about the varnish-commit mailing list