[master] c0096f7 Lay #1397 to rest: It was something as trivial as a typo from my side, but staring at the wrong assert for hours on end did not reveal that.

Poul-Henning Kamp phk at FreeBSD.org
Mon Jan 6 21:46:03 CET 2014


commit c0096f759b8af324d1253993fd76960ecbd2e399
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 6 20:45:10 2014 +0000

    Lay #1397 to rest:  It was something as trivial as a typo from my
    side, but staring at the wrong assert for hours on end did not
    reveal that.
    
    Many thanks to:		scoof
    Fixes #1397

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index f251074..3a00269 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -626,11 +626,12 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
 			al += tl;
 			sp = (char *)sp + tl;
 			sl -= tl;
-			VBO_extend(bo, al);
+			VBO_extend(bo, tl);
 			if (st->len == st->space)
 				st = NULL;
 		}
-	} while (ois == OIS_DATA || ois == OIS_STREAM);
+	} while (bo->state < BOS_FAILED &&
+	    (ois == OIS_DATA || ois == OIS_STREAM));
 	ObjIterEnd(&oi);
 	bo->stats = NULL;
 	if (bo->state != BOS_FAILED) {
diff --git a/bin/varnishtest/tests/b00025.vtc b/bin/varnishtest/tests/b00025.vtc
index 3ba0e64..05536ab 100644
--- a/bin/varnishtest/tests/b00025.vtc
+++ b/bin/varnishtest/tests/b00025.vtc
@@ -16,6 +16,9 @@ varnish v1 -vcl {
 	}
 } -start
 
+# Fragmenting storage tests for #1397
+varnish v1 -cliok "debug.fragfetch 4"
+
 client c1 {
 	txreq
 	rxresp
diff --git a/bin/varnishtest/tests/r01399.vtc b/bin/varnishtest/tests/r01399.vtc
index d2ea1d0..48a0bc0 100644
--- a/bin/varnishtest/tests/r01399.vtc
+++ b/bin/varnishtest/tests/r01399.vtc
@@ -29,7 +29,7 @@ varnish v1 -vcl+backend {
 } -start
 
 client c1 {
-	txreq 
+	txreq
 	rxresp
 	expect resp.http.content-length == 1
 
@@ -39,7 +39,7 @@ client c1 {
 delay 3
 
 client c1 {
-	txreq 
+	txreq
 	rxresp
 	expect resp.http.content-length == 1
 	sema r1 sync 2



More information about the varnish-commit mailing list