mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-02-04 00:41:41 +01:00
BUG/MINOR: pattern: Rely on the sample type to copy it in pattern_exec_match
To be thread safe, the function pattern_exec_match copy data (the pattern and the inner sample) in thread-local variables. But when the sample is duplicated, we must check its type and not the pattern one. This is specific to threads, no backport is needed.
This commit is contained in:
parent
c5a9d5bf23
commit
09fdf4b112
@ -2592,7 +2592,7 @@ struct pattern *pattern_exec_match(struct pattern_head *head, struct sample *smp
|
||||
/* We also duplicate the sample data for
|
||||
same reason */
|
||||
if (pat->data && (pat->data != &static_sample_data)) {
|
||||
switch(pat->type) {
|
||||
switch(pat->data->type) {
|
||||
case SMP_T_STR:
|
||||
static_sample_data.type = SMP_T_STR;
|
||||
static_sample_data.u.str = *get_trash_chunk();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user