]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: pattern: use ebtree's longest match to index/lookup string beginning
authorWilly Tarreau <w@1wt.eu>
Sat, 10 May 2014 06:53:48 +0000 (08:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 10 May 2014 06:53:48 +0000 (08:53 +0200)
commitb1dd9bf308c5274f129922625876894dee427ea9
tree70844dfaa75af380935978b3d0d9380002e99958
parent9f791939846c7d3cf8117c1fa627837e75eedd64
MEDIUM: pattern: use ebtree's longest match to index/lookup string beginning

Being able to map prefixes to values is already used for IPv4/IPv6
but was not yet used with strings. It can be very convenient to map
directories to server farms but large lists may be slow.

By using ebmb_insert_prefix() and ebmb_lookup_longest(), we can
insert strings with their own length as a prefix, and lookup
candidate strings and ensure that the longest matching one will
be returned, which is the longest string matching the entry.
include/proto/pattern.h
src/pattern.c