]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] stick table purge failure if size less than 255
authorEmeric Brun <ebrun@exceliance.fr>
Thu, 23 Sep 2010 16:10:00 +0000 (18:10 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Nov 2010 08:28:18 +0000 (09:28 +0100)
If table size is lower than 256, we can't force to purge old entries.
This patch should be backported to 1.4.

src/stick_table.c

index 78a0df7514876d649f7b7578464ef69cfa6da8e5..cb9b6b31394806fac3ca79fbff21fddb23523c9b 100644 (file)
@@ -158,7 +158,7 @@ struct stksess *stksess_new(struct stktable *t, struct stktable_key *key)
                if ( t->nopurge )
                        return NULL;
 
-               if (!stktable_trash_oldest(t, t->size >> 8))
+               if (!stktable_trash_oldest(t, (t->size >> 8) + 1))
                        return NULL;
        }