[master] 3deb1c3 Correct fix for #1395, I wasn't paying attention to what the test-case actually wanted to do.

Poul-Henning Kamp phk at FreeBSD.org
Fri Jan 3 16:02:15 CET 2014


commit 3deb1c39ad924a9d44f546ec188a5735f9f9284c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Jan 3 15:01:15 2014 +0000

    Correct fix for #1395, I wasn't paying attention to what the test-case
    actually wanted to do.
    
    Hat-tip:	scn

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 9e82921..e142103 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -190,6 +190,7 @@ vbf_stp_fetchhdr(struct worker *wrk, struct busyobj *bo)
 
 	if (i) {
 		AZ(bo->vbc);
+		(void)VFP_Error(bo, "Failed to fetch object headers");
 		make_it_503(bo);
 	} else {
 		AN(bo->vbc);
@@ -452,8 +453,10 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 	if (bo->do_stream)
 		HSH_Unbusy(&wrk->stats, obj->objcore);
 
-	assert(bo->state == BOS_REQ_DONE);
-	VBO_setstate(bo, BOS_FETCHING);
+	if (bo->state == BOS_REQ_DONE)
+		VBO_setstate(bo, BOS_FETCHING);
+	else if (bo->state != BOS_FAILED)
+		WRONG("Wrong bo->state");
 
 	switch (bo->htc.body_status) {
 	case BS_NONE:
diff --git a/bin/varnishtest/tests/b00015.vtc b/bin/varnishtest/tests/b00015.vtc
index 029f782..9905e96 100644
--- a/bin/varnishtest/tests/b00015.vtc
+++ b/bin/varnishtest/tests/b00015.vtc
@@ -21,7 +21,7 @@ client c1 {
 	txreq -url "/"
 	rxresp
 	expect resp.status == 503
-	expect resp.http.X-varnish == "1004"
+	expect resp.http.X-varnish == "1005"
 } -run
 
 delay .1
@@ -46,7 +46,7 @@ client c1 {
 	txreq -url "/"
 	rxresp
 	expect resp.status == 302
-	expect resp.http.X-varnish == "1007"
+	expect resp.http.X-varnish == "1009"
 } -run
 
 delay .1
@@ -55,7 +55,7 @@ client c1 {
 	txreq -url "/"
 	rxresp
 	expect resp.status == 302
-	expect resp.http.X-varnish == "1010 1008"
+	expect resp.http.X-varnish == "1012 1010"
 } -run
 
 delay .1
@@ -79,7 +79,7 @@ client c1 {
 	txreq -url "/2"
 	rxresp
 	expect resp.status == 502
-	expect resp.http.X-varnish == "1012"
+	expect resp.http.X-varnish == "1014"
 } -run
 
 delay .1
@@ -88,7 +88,7 @@ client c1 {
 	txreq -url "/2"
 	rxresp
 	expect resp.status == 502
-	expect resp.http.X-varnish == "1015 1013"
+	expect resp.http.X-varnish == "1017 1015"
 } -run
 
 delay .1
diff --git a/bin/varnishtest/tests/r01337.vtc b/bin/varnishtest/tests/r01337.vtc
index 1af5573..ccb1b80 100644
--- a/bin/varnishtest/tests/r01337.vtc
+++ b/bin/varnishtest/tests/r01337.vtc
@@ -52,27 +52,43 @@ client c1 {
 	txreq -url /small
 	rxresp
 	expect resp.status == 503
+} -run
+client c1 {
 	txreq -url /low
 	rxresp
 	expect resp.status == 503
+} -run
+client c1 {
 	txreq -url /high
 	rxresp
 	expect resp.status == 503
+} -run
+client c1 {
 	txreq -url /X
 	rxresp
 	expect resp.status == 503
+} -run
+client c1 {
 	txreq -url /Y
 	rxresp
 	expect resp.status == 503
+} -run
+client c1 {
 	txreq -url /Z
 	rxresp
 	expect resp.status == 503
+} -run
+client c1 {
 	txreq -url /x
 	rxresp
 	expect resp.status == 503
+} -run
+client c1 {
 	txreq -url /y
 	rxresp
 	expect resp.status == 503
+} -run
+client c1 {
 	txreq -url /z
 	rxresp
 	expect resp.status == 503
diff --git a/bin/varnishtest/tests/r01395.vtc b/bin/varnishtest/tests/r01395.vtc
index 77506a4..c3243f6 100644
--- a/bin/varnishtest/tests/r01395.vtc
+++ b/bin/varnishtest/tests/r01395.vtc
@@ -6,12 +6,12 @@ varnish v1 -vcl {
 	}
 
 	sub vcl_error {
-		set obj.status = 200;
+		set obj.status = 299;
 	}
 } -start
 
 client c1 {
 	txreq -url "/"
 	rxresp
-	expect resp.status == 503
+	expect resp.status == 299
 } -run
diff --git a/bin/varnishtest/tests/r01398.vtc b/bin/varnishtest/tests/r01398.vtc
index 6c5cb7d..fe89e0d 100644
--- a/bin/varnishtest/tests/r01398.vtc
+++ b/bin/varnishtest/tests/r01398.vtc
@@ -14,7 +14,7 @@ client c1 {
 	txreq
 	rxresp
 	expect resp.status == 503
-	expect resp.http.X-BE-Name == foo
-	expect resp.http.X-BE-IP == ""
+	expect resp.http.X-BE-Name == "<undef>"
+	expect resp.http.X-BE-IP == "<undef>"
 } -run
 



More information about the varnish-commit mailing list