MINOR: listener: small API change
A minor API change was performed in listener(.c/.h) to restore consistency
between stop_listener() and (resume/pause)_listener() functions.
LISTENER_LOCK was never locked prior to calling stop_listener():
lli variable hint is thus not useful anymore.
Added PROXY_LOCK locking in (resume/pause)_listener() functions
with related lpx variable hint (prerequisite for #1626).
It should be backported to 2.6, 2.5 and 2.4
(cherry picked from commit 001328873c352e5e4b1df0dcc8facaf2fc1408aa)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 614f99ee0a9f71f85f12e88b0a113ede1e51ae40)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit e3b32c01df854610096487c1f1430224892248a4)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/protocol.c b/src/protocol.c
index 767e03a..1806bed 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -155,7 +155,7 @@
list_for_each_entry(proto, &protocols, list) {
list_for_each_entry_safe(listener, lback, &proto->receivers, rx.proto_list)
if (!listener->bind_conf->frontend->grace)
- stop_listener(listener, 0, 1, 0);
+ stop_listener(listener, 0, 1);
}
HA_SPIN_UNLOCK(PROTO_LOCK, &proto_lock);
}
@@ -175,7 +175,7 @@
HA_SPIN_LOCK(PROTO_LOCK, &proto_lock);
list_for_each_entry(proto, &protocols, list) {
list_for_each_entry(listener, &proto->receivers, rx.proto_list)
- if (!pause_listener(listener))
+ if (!pause_listener(listener, 0))
err |= ERR_FATAL;
}
HA_SPIN_UNLOCK(PROTO_LOCK, &proto_lock);
@@ -197,7 +197,7 @@
HA_SPIN_LOCK(PROTO_LOCK, &proto_lock);
list_for_each_entry(proto, &protocols, list) {
list_for_each_entry(listener, &proto->receivers, rx.proto_list)
- if (!resume_listener(listener))
+ if (!resume_listener(listener, 0))
err |= ERR_FATAL;
}
HA_SPIN_UNLOCK(PROTO_LOCK, &proto_lock);