[master] 911d4d5 Initialize wrk->lastused if still NaN

Nils Goroll nils.goroll at uplex.de
Thu Apr 21 07:46:04 CEST 2016


commit 911d4d5afd49f3f3165755ef0d6deccd5f35f927
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Apr 21 07:36:53 2016 +0200

    Initialize wrk->lastused if still NaN
    
    Fixes #1917

diff --git a/bin/varnishd/storage/storage_simple.c b/bin/varnishd/storage/storage_simple.c
index dea59de..075d866 100644
--- a/bin/varnishd/storage/storage_simple.c
+++ b/bin/varnishd/storage/storage_simple.c
@@ -41,6 +41,8 @@
 
 #include "vsb.h"
 
+#include "vtim.h"
+
 /*-------------------------------------------------------------------*/
 
 static struct storage *
@@ -498,8 +500,11 @@ sml_bocdone(struct worker *wrk, struct objcore *oc, struct boc *boc)
 		sml_stv_free(stv, st);
 	}
 
-	if (stv->lru != NULL)
+	if (stv->lru != NULL) {
+		if (isnan(wrk->lastused))
+			wrk->lastused = VTIM_real();
 		LRU_Add(oc, wrk->lastused);	// approx timestamp is OK
+	}
 }
 
 static const void * __match_proto__(objgetattr_f)



More information about the varnish-commit mailing list