1 commit 8276ea30400887cb25186571ac62252da97b91df
2 Author: Christopher Faulet <cfaulet@haproxy.com>
3 Date: Fri Apr 19 14:50:55 2019 +0200
5 BUG/MEDIUM: thread/http: Add missing locks in set-map and add-acl HTTP rules
7 Locks are missing in the rules "http-request set-map" and "http-response
8 add-acl" when an acl or map update is performed. Pattern elements must be
11 This patch must be backported to 1.9 and 1.8. For the 1.8, the HTX part must be
14 (cherry picked from commit e84289e5854aa3b00cd19032387f435ca6748491)
15 Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
16 (cherry picked from commit 82dedc4add923bd1ff1b47a559a23e83886521a8)
17 Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
19 diff --git a/src/proto_http.c b/src/proto_http.c
20 index 9beaa137..ccacd6a4 100644
21 --- a/src/proto_http.c
22 +++ b/src/proto_http.c
23 @@ -2717,12 +2717,14 @@ resume_execution:
24 value->str[value->len] = '\0';
27 + HA_SPIN_LOCK(PATREF_LOCK, &ref->lock);
28 if (pat_ref_find_elt(ref, key->str) != NULL)
29 /* update entry if it exists */
30 pat_ref_set(ref, key->str, value->str, NULL);
32 /* insert a new entry */
33 pat_ref_add(ref, key->str, value->str, NULL);
34 + HA_SPIN_UNLOCK(PATREF_LOCK, &ref->lock);
36 free_trash_chunk(key);
37 free_trash_chunk(value);
38 @@ -2978,8 +2980,10 @@ resume_execution:
41 /* check if the entry already exists */
42 + HA_SPIN_LOCK(PATREF_LOCK, &ref->lock);
43 if (pat_ref_find_elt(ref, key->str) == NULL)
44 pat_ref_add(ref, key->str, NULL, NULL);
45 + HA_SPIN_UNLOCK(PATREF_LOCK, &ref->lock);
47 free_trash_chunk(key);