r3858 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Mar 2 17:15:58 CET 2009


Author: phk
Date: 2009-03-02 17:15:58 +0100 (Mon, 02 Mar 2009)
New Revision: 3858

Modified:
   trunk/varnish-cache/bin/varnishd/hash_critbit.c
Log:
Add a missing refcnt in the case where we lost a collision while
doing the lockless lookup.



Modified: trunk/varnish-cache/bin/varnishd/hash_critbit.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_critbit.c	2009-03-02 14:38:55 UTC (rev 3857)
+++ trunk/varnish-cache/bin/varnishd/hash_critbit.c	2009-03-02 16:15:58 UTC (rev 3858)
@@ -443,12 +443,14 @@
 		fprintf(stderr, "hcb_lookup %d\n", __LINE__);
 #endif
 	} else {
+		CHECK_OBJ_NOTNULL(noh, OBJHEAD_MAGIC);
 		free(noh->hash);
 		noh->hash = NULL;
 		VSL_stats->hcb_lock++;
 #ifdef PHK
 		fprintf(stderr, "hcb_lookup %d\n", __LINE__);
 #endif
+		oh->refcnt++;
 	}
 	Lck_Unlock(&hcb_mtx);
 	return (oh);



More information about the varnish-commit mailing list