]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: pattern: don't load more than once a pattern list.
authorThierry FOURNIER <tfournier@exceliance.fr>
Mon, 24 Nov 2014 10:14:42 +0000 (11:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Nov 2014 14:40:16 +0000 (15:40 +0100)
commit315ec4217f912f6cc8fcf98624d852f9cd8399f9
tree5d0e2814430a564eb028fe8bdf1c056290fc7ad2
parentcbf8cf68f5a20340a1055bdcc2d9502f9e0dd35b
BUG/MEDIUM: pattern: don't load more than once a pattern list.

A memory optimization can use the same pattern expression for many
equal pattern list (same parse method, index method and index_smp
method).

The pattern expression is returned by "pattern_new_expr", but this
function dont indicate if the returned pattern is already in use.

So, the caller function reload the list of patterns in addition with
the existing patterns. This behavior is not a problem with tree indexed
pattern, but it grows the lists indexed patterns.

This fix add a "reuse" flag in return of the function "pattern_new_expr".
If the flag is set, I suppose that the patterns are already loaded.

This fix must be backported into 1.5.
include/proto/pattern.h
src/acl.c
src/pattern.c