[experimental-ims] b40bb36 Don't zap the size until we have updated statistics

Geoff Simmons geoff at varnish-cache.org
Wed Aug 31 16:00:18 CEST 2011


commit b40bb3667c01f3625d237f98848d34501e1c9fb2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Aug 10 07:50:13 2011 +0000

    Don't zap the size until we have updated statistics

diff --git a/bin/varnishd/storage_malloc.c b/bin/varnishd/storage_malloc.c
index 7035ff0..178973a 100644
--- a/bin/varnishd/storage_malloc.c
+++ b/bin/varnishd/storage_malloc.c
@@ -67,8 +67,8 @@ sma_alloc(struct stevedore *st, size_t size)
 	Lck_Lock(&sma_sc->sma_mtx);
 	sma_sc->stats->c_req++;
 	if (sma_sc->sma_alloc + size > sma_sc->sma_max) {
-		size = 0;
 		sma_sc->stats->c_fail += size;
+		size = 0;
 	} else {
 		sma_sc->sma_alloc += size;
 		sma_sc->stats->c_bytes += size;



More information about the varnish-commit mailing list