[master] 5efd7ebb1 Add error handling for last-resort VDP_END

Nils Goroll nils.goroll at uplex.de
Fri Jan 15 17:49:09 UTC 2021


commit 5efd7ebb10701c745a0e00a6cf2c85b4ca669d39
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Fri Jan 15 18:45:25 2021 +0100

    Add error handling for last-resort VDP_END
    
    We lacked error handling in the call to ensure that VDP_END is being sent.
    
    Now we return the first error seen, which can be the one from the last
    resort VDP_END call.
    
    Flexelint c2d45aefb563bb105f524b67b84d20649ecb85a2
    
    Ref #3298

diff --git a/bin/varnishd/storage/storage_simple.c b/bin/varnishd/storage/storage_simple.c
index bc13f443c..314da53fe 100644
--- a/bin/varnishd/storage/storage_simple.c
+++ b/bin/varnishd/storage/storage_simple.c
@@ -243,7 +243,7 @@ sml_iterator(struct worker *wrk, struct objcore *oc,
 	const struct stevedore *stv;
 	ssize_t checkpoint_len = 0;
 	ssize_t len = 0;
-	int ret = 0;
+	int ret = 0, ret2;
 	ssize_t ol;
 	ssize_t nl;
 	ssize_t sl;
@@ -343,8 +343,11 @@ sml_iterator(struct worker *wrk, struct objcore *oc,
 			break;
 	}
 	HSH_DerefBoc(wrk, oc);
-	if ((u & OBJ_ITER_END) == 0)
-		func(priv, OBJ_ITER_END, NULL, 0);
+	if ((u & OBJ_ITER_END) == 0) {
+		ret2 = func(priv, OBJ_ITER_END, NULL, 0);
+		if (ret == 0)
+			ret = ret2;
+	}
 	return (ret);
 }
 


More information about the varnish-commit mailing list