forked from pool/haproxy
20b0b77293
1 OBS-URL: https://build.opensuse.org/request/show/298279 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/haproxy?expand=0&rev=27
50 lines
2.0 KiB
Diff
50 lines
2.0 KiB
Diff
From 06f823d50473c3dc31732b38c81a6010587f01a4 Mon Sep 17 00:00:00 2001
|
|
From: Willy Tarreau <w@1wt.eu>
|
|
Date: Tue, 14 Apr 2015 12:07:16 +0200
|
|
Subject: [PATCH 11/12] BUG/MEDIUM: listener: don't report an error when
|
|
resuming unbound listeners
|
|
|
|
Pavlos Parissis reported that a sequence of disable/enable on a frontend
|
|
performed on the CLI can result in an error if the frontend has several
|
|
"bind" lines each bound to different processes. This is because the
|
|
resume_listener() function returns a failure for frontends not part of
|
|
the current process instead of returning a success to pretend there was
|
|
no failure.
|
|
|
|
This fix should be backported to 1.5.
|
|
(cherry picked from commit af2fd584f32ec72b3d6d27a915f15df8041b56e7)
|
|
---
|
|
src/listener.c | 9 +++++----
|
|
1 file changed, 5 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/listener.c b/src/listener.c
|
|
index 11df69f..21eba52 100644
|
|
--- a/src/listener.c
|
|
+++ b/src/listener.c
|
|
@@ -120,9 +120,10 @@ int pause_listener(struct listener *l)
|
|
* may replace enable_listener(). The resulting state will either be LI_READY
|
|
* or LI_FULL. 0 is returned in case of failure to resume (eg: dead socket).
|
|
* Listeners bound to a different process are not woken up unless we're in
|
|
- * foreground mode. If the listener was only in the assigned state, it's totally
|
|
- * rebound. This can happen if a pause() has completely stopped it. If the
|
|
- * resume fails, 0 is returned and an error might be displayed.
|
|
+ * foreground mode, and are ignored. If the listener was only in the assigned
|
|
+ * state, it's totally rebound. This can happen if a pause() has completely
|
|
+ * stopped it. If the resume fails, 0 is returned and an error might be
|
|
+ * displayed.
|
|
*/
|
|
int resume_listener(struct listener *l)
|
|
{
|
|
@@ -146,7 +147,7 @@ int resume_listener(struct listener *l)
|
|
if ((global.mode & (MODE_DAEMON | MODE_SYSTEMD)) &&
|
|
l->bind_conf->bind_proc &&
|
|
!(l->bind_conf->bind_proc & (1UL << (relative_pid - 1))))
|
|
- return 0;
|
|
+ return 1;
|
|
|
|
if (l->proto->sock_prot == IPPROTO_TCP &&
|
|
l->state == LI_PAUSED &&
|
|
--
|
|
2.1.4
|
|
|