Browse Source

haproxy: maintenance release to fix no critical bugs

 - bump to version 1.5.5

Signed-off-by: Thomas Heil <heil@terminal-consulting.de>
Thomas Heil 10 years ago
parent
commit
f42d4f63ee
21 changed files with 3 additions and 1649 deletions
  1. 3
    3
      net/haproxy/Makefile
  2. 0
    34
      net/haproxy/patches/0001-DOC-clearly-state-that-the-show-sess-output-format-i.patch
  3. 0
    27
      net/haproxy/patches/0002-MINOR-stats-fix-minor-typo-fix-in-stats_dump_errors_.patch
  4. 0
    104
      net/haproxy/patches/0003-MEDIUM-Improve-signal-handling-in-systemd-wrapper.patch
  5. 0
    47
      net/haproxy/patches/0004-MINOR-Also-accept-SIGHUP-SIGTERM-in-systemd-wrapper.patch
  6. 0
    51
      net/haproxy/patches/0005-DOC-indicate-in-the-doc-that-track-sc-can-wait-if-da.patch
  7. 0
    79
      net/haproxy/patches/0006-MEDIUM-http-enable-header-manipulation-for-101-respo.patch
  8. 0
    59
      net/haproxy/patches/0007-BUG-MEDIUM-config-propagate-frontend-to-backend-proc.patch
  9. 0
    141
      net/haproxy/patches/0008-MEDIUM-config-properly-propagate-process-binding-bet.patch
  10. 0
    92
      net/haproxy/patches/0009-MEDIUM-config-make-the-frontends-automatically-bind-.patch
  11. 0
    208
      net/haproxy/patches/0010-MEDIUM-config-compute-the-exact-bind-process-before-.patch
  12. 0
    44
      net/haproxy/patches/0011-MEDIUM-config-only-warn-if-stats-are-attached-to-mul.patch
  13. 0
    109
      net/haproxy/patches/0012-MEDIUM-config-report-it-when-tcp-request-rules-are-m.patch
  14. 0
    51
      net/haproxy/patches/0013-MINOR-config-detect-the-case-where-a-tcp-request-con.patch
  15. 0
    89
      net/haproxy/patches/0014-MEDIUM-systemd-wrapper-support-multiple-executable-v.patch
  16. 0
    35
      net/haproxy/patches/0015-BUG-MEDIUM-remove-debugging-code-from-systemd-wrappe.patch
  17. 0
    187
      net/haproxy/patches/0016-BUG-MEDIUM-http-adjust-close-mode-when-switching-to-.patch
  18. 0
    45
      net/haproxy/patches/0017-BUG-MINOR-config-don-t-propagate-process-binding-on-.patch
  19. 0
    101
      net/haproxy/patches/0018-BUG-MEDIUM-check-rule-less-tcp-check-must-detect-con.patch
  20. 0
    110
      net/haproxy/patches/0019-BUG-MINOR-tcp-check-report-the-correct-failed-step-i.patch
  21. 0
    33
      net/haproxy/patches/0020-BUG-MINOR-config-don-t-propagate-process-binding-for.patch

+ 3
- 3
net/haproxy/Makefile View File

@@ -9,12 +9,12 @@
9 9
 include $(TOPDIR)/rules.mk
10 10
 
11 11
 PKG_NAME:=haproxy
12
-PKG_VERSION:=1.5.4
13
-PKG_RELEASE:=20
12
+PKG_VERSION:=1.5.5
13
+PKG_RELEASE:=00
14 14
 PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.5/src/
16 16
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
17
-PKG_MD5SUM:=b027035bfd8f28326634f802c3447a34
17
+PKG_MD5SUM:=952e4c2057d763a3fb74173a81028be5
18 18
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
19 19
 PKG_LICENSE:=GPL-2.0
20 20
 

+ 0
- 34
net/haproxy/patches/0001-DOC-clearly-state-that-the-show-sess-output-format-i.patch View File

@@ -1,35 +0,0 @@
1
-From e99d44d4bc3423b721c7f654fd1778b9822a94e3 Mon Sep 17 00:00:00 2001
2
-From: Olivier <webmaster@ajeux.com>
3
-Date: Fri, 5 Sep 2014 18:49:10 +0200
4
-Subject: [PATCH 01/13] DOC: clearly state that the "show sess" output format
5
- is not fixed
6
-
7
-It requires to look at the code (src/dumpstats.c) since the format may
8
-change at any moment.
9
-(cherry picked from commit ce31e6e3baebe75a2e6f6b5c66553db8d76dff0c)
10
----
11
- doc/configuration.txt | 8 +++++---
12
- 1 file changed, 5 insertions(+), 3 deletions(-)
13
-
14
-diff --git a/doc/configuration.txt b/doc/configuration.txt
15
-index 19df5ae..1ecf15a 100644
16
---- a/doc/configuration.txt
17
-+++ b/doc/configuration.txt
18
-@@ -13734,9 +13734,11 @@ show sess <id>
19
-   of "show sess" (it corresponds to the session pointer). Those information are
20
-   useless to most users but may be used by haproxy developers to troubleshoot a
21
-   complex bug. The output format is intentionally not documented so that it can
22
--  freely evolve depending on demands. The special id "all" dumps the states of
23
--  all sessions, which can be avoided as much as possible as it is highly CPU
24
--  intensive and can take a lot of time.
25
-+  freely evolve depending on demands. You may find a description of all fields
26
-+  returned in src/dumpstats.c
27
-+
28
-+  The special id "all" dumps the states of all sessions, which must be avoided
29
-+  as much as possible as it is highly CPU intensive and can take a lot of time.
30
- 
31
- show stat [<iid> <type> <sid>]
32
-   Dump statistics in the CSV format. By passing <id>, <type> and <sid>, it is
33
-1.8.5.5
34
-

+ 0
- 27
net/haproxy/patches/0002-MINOR-stats-fix-minor-typo-fix-in-stats_dump_errors_.patch View File

@@ -1,28 +0,0 @@
1
-From 815d7d5c348575181874429b93b0ebdb0cf873c2 Mon Sep 17 00:00:00 2001
2
-From: Olivier Doucet <webmaster@ajeux.com>
3
-Date: Mon, 8 Sep 2014 11:23:00 +0200
4
-Subject: [PATCH 02/13] MINOR: stats: fix minor typo fix in
5
- stats_dump_errors_to_buffer()
6
-
7
-Remove the space before the colon to match the format used in the frontend.
8
-(cherry picked from commit 08afdcb47bc39c071787f8fc2066776e1c5e8607)
9
----
10
- src/dumpstats.c | 2 +-
11
- 1 file changed, 1 insertion(+), 1 deletion(-)
12
-
13
-diff --git a/src/dumpstats.c b/src/dumpstats.c
14
-index 5365042..09bc7f6 100644
15
---- a/src/dumpstats.c
16
-+++ b/src/dumpstats.c
17
-@@ -6045,7 +6045,7 @@ static int stats_dump_errors_to_buffer(struct stream_interface *si)
18
- 				break;
19
- 			case 1:
20
- 				chunk_appendf(&trash,
21
--					     " backend %s (#%d) : invalid response\n"
22
-+					     " backend %s (#%d): invalid response\n"
23
- 					     "  frontend %s (#%d)",
24
- 					     appctx->ctx.errors.px->id, appctx->ctx.errors.px->uuid,
25
- 					     es->oe->id, es->oe->uuid);
26
-1.8.5.5
27
-

+ 0
- 104
net/haproxy/patches/0003-MEDIUM-Improve-signal-handling-in-systemd-wrapper.patch View File

@@ -1,105 +0,0 @@
1
-From 62c8565cd5bbda6ac0dd818fa26922eeaef1605c Mon Sep 17 00:00:00 2001
2
-From: Conrad Hoffmann <conrad@soundcloud.com>
3
-Date: Mon, 28 Jul 2014 23:52:20 +0200
4
-Subject: [PATCH 03/13] MEDIUM: Improve signal handling in systemd wrapper.
5
-
6
-Move all code out of the signal handlers, since this is potentially
7
-dangerous. To make sure the signal handlers behave as expected, use
8
-sigaction() instead of signal(). That also obsoletes messing with
9
-the signal mask after restart.
10
-
11
-Signed-off-by: Conrad Hoffmann <conrad@soundcloud.com>
12
-(cherry picked from commit 5b5ea9c93384da49eea0f67ebed0966d4167b17a)
13
----
14
- src/haproxy-systemd-wrapper.c | 37 ++++++++++++++++++++++++-------------
15
- 1 file changed, 24 insertions(+), 13 deletions(-)
16
-
17
-diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c
18
-index 529b213..90a94ce 100644
19
---- a/src/haproxy-systemd-wrapper.c
20
-+++ b/src/haproxy-systemd-wrapper.c
21
-@@ -22,6 +22,8 @@
22
- #define SD_DEBUG "<7>"
23
- #define SD_NOTICE "<5>"
24
- 
25
-+static volatile sig_atomic_t caught_signal;
26
-+
27
- static char *pid_file = "/run/haproxy.pid";
28
- static int wrapper_argc;
29
- static char **wrapper_argv;
30
-@@ -103,7 +105,12 @@ static int read_pids(char ***pid_strv)
31
- 	return read;
32
- }
33
- 
34
--static void sigusr2_handler(int signum __attribute__((unused)))
35
-+static void signal_handler(int signum)
36
-+{
37
-+	caught_signal = signum;
38
-+}
39
-+
40
-+static void do_restart(void)
41
- {
42
- 	setenv(REEXEC_FLAG, "1", 1);
43
- 	fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: re-executing\n");
44
-@@ -111,7 +118,7 @@ static void sigusr2_handler(int signum __attribute__((unused)))
45
- 	execv(wrapper_argv[0], wrapper_argv);
46
- }
47
- 
48
--static void sigint_handler(int signum __attribute__((unused)))
49
-+static void do_shutdown(void)
50
- {
51
- 	int i, pid;
52
- 	char **pid_strv = NULL;
53
-@@ -147,25 +154,21 @@ int main(int argc, char **argv)
54
- 	--argc; ++argv;
55
- 	init(argc, argv);
56
- 
57
--	signal(SIGINT, &sigint_handler);
58
--	signal(SIGUSR2, &sigusr2_handler);
59
-+	struct sigaction sa;
60
-+	memset(&sa, 0, sizeof(struct sigaction));
61
-+	sa.sa_handler = &signal_handler;
62
-+	sigaction(SIGUSR2, &sa, NULL);
63
-+	sigaction(SIGINT, &sa, NULL);
64
- 
65
- 	if (getenv(REEXEC_FLAG) != NULL) {
66
- 		/* We are being re-executed: restart HAProxy gracefully */
67
- 		int i;
68
- 		char **pid_strv = NULL;
69
- 		int nb_pid = read_pids(&pid_strv);
70
--		sigset_t sigs;
71
- 
72
- 		unsetenv(REEXEC_FLAG);
73
- 		spawn_haproxy(pid_strv, nb_pid);
74
- 
75
--		/* Unblock SIGUSR2 which was blocked by the signal handler
76
--		 * before re-exec */
77
--		sigprocmask(SIG_BLOCK, NULL, &sigs);
78
--		sigdelset(&sigs, SIGUSR2);
79
--		sigprocmask(SIG_SETMASK, &sigs, NULL);
80
--
81
- 		for (i = 0; i < nb_pid; ++i)
82
- 			free(pid_strv[i]);
83
- 		free(pid_strv);
84
-@@ -176,8 +179,16 @@ int main(int argc, char **argv)
85
- 	}
86
- 
87
- 	status = -1;
88
--	while (-1 != wait(&status) || errno == EINTR)
89
--		;
90
-+	while (-1 != wait(&status) || errno == EINTR) {
91
-+		if (caught_signal == SIGUSR2) {
92
-+			caught_signal = 0;
93
-+			do_restart();
94
-+		}
95
-+		else if (caught_signal == SIGINT) {
96
-+			caught_signal = 0;
97
-+			do_shutdown();
98
-+		}
99
-+	}
100
- 
101
- 	fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: exit, haproxy RC=%d\n",
102
- 			status);
103
-1.8.5.5
104
-

+ 0
- 47
net/haproxy/patches/0004-MINOR-Also-accept-SIGHUP-SIGTERM-in-systemd-wrapper.patch View File

@@ -1,48 +0,0 @@
1
-From 6bb7bf7949dd019403b65f400c4b3d0d8589327b Mon Sep 17 00:00:00 2001
2
-From: Matt Robenolt <matt@ydekproductions.com>
3
-Date: Thu, 11 Sep 2014 05:19:30 +0000
4
-Subject: [PATCH 04/13] MINOR: Also accept SIGHUP/SIGTERM in systemd-wrapper
5
-
6
-My proposal is to let haproxy-systemd-wrapper also accept normal
7
-SIGHUP/SIGTERM signals to play nicely with other process managers
8
-besides just systemd. In my use case, this will be for using with
9
-runit which has to ability to change the signal used for a
10
-"reload" or "stop" command. It also might be worth renaming this
11
-bin to just haproxy-wrapper or something of that sort to separate
12
-itself away from systemd. But that's a different discussion. :)
13
-(cherry picked from commit c54bdd2a118161b4dc36963b4201edfa7341dadb)
14
----
15
- src/haproxy-systemd-wrapper.c | 6 ++++--
16
- 1 file changed, 4 insertions(+), 2 deletions(-)
17
-
18
-diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c
19
-index 90a94ce..cc8baa8 100644
20
---- a/src/haproxy-systemd-wrapper.c
21
-+++ b/src/haproxy-systemd-wrapper.c
22
-@@ -158,7 +158,9 @@ int main(int argc, char **argv)
23
- 	memset(&sa, 0, sizeof(struct sigaction));
24
- 	sa.sa_handler = &signal_handler;
25
- 	sigaction(SIGUSR2, &sa, NULL);
26
-+	sigaction(SIGHUP, &sa, NULL);
27
- 	sigaction(SIGINT, &sa, NULL);
28
-+	sigaction(SIGTERM, &sa, NULL);
29
- 
30
- 	if (getenv(REEXEC_FLAG) != NULL) {
31
- 		/* We are being re-executed: restart HAProxy gracefully */
32
-@@ -180,11 +182,11 @@ int main(int argc, char **argv)
33
- 
34
- 	status = -1;
35
- 	while (-1 != wait(&status) || errno == EINTR) {
36
--		if (caught_signal == SIGUSR2) {
37
-+		if (caught_signal == SIGUSR2 || caught_signal == SIGHUP) {
38
- 			caught_signal = 0;
39
- 			do_restart();
40
- 		}
41
--		else if (caught_signal == SIGINT) {
42
-+		else if (caught_signal == SIGINT || caught_signal == SIGTERM) {
43
- 			caught_signal = 0;
44
- 			do_shutdown();
45
- 		}
46
-1.8.5.5
47
-

+ 0
- 51
net/haproxy/patches/0005-DOC-indicate-in-the-doc-that-track-sc-can-wait-if-da.patch View File

@@ -1,52 +0,0 @@
1
-From 531485c08ffb15b939a28ecf47090e4c93341d1b Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Tue, 16 Sep 2014 15:48:15 +0200
4
-Subject: [PATCH 05/13] DOC: indicate in the doc that track-sc* can wait if
5
- data are missing
6
-
7
-Since commit 1b71eb5 ("BUG/MEDIUM: counters: fix track-sc* to wait on
8
-unstable contents"), we don't need the "if HTTP" anymore. But the doc
9
-was not updated to reflect this.
10
-
11
-Since this change was backported to 1.5, this doc update should be
12
-backported as well.
13
-(cherry picked from commit 4d54c7ca0286588de5060acce9aff8aa9645bb98)
14
----
15
- doc/configuration.txt | 10 +++++-----
16
- 1 file changed, 5 insertions(+), 5 deletions(-)
17
-
18
-diff --git a/doc/configuration.txt b/doc/configuration.txt
19
-index 1ecf15a..3c75c92 100644
20
---- a/doc/configuration.txt
21
-+++ b/doc/configuration.txt
22
-@@ -7470,9 +7470,9 @@ tcp-request content <action> [{if | unless} <condition>]
23
-   contents will always be immediately present when the rule is evaluated first.
24
- 
25
-   Tracking layer7 information is also possible provided that the information
26
--  are present when the rule is processed. The current solution for making the
27
--  rule engine wait for such information is to set an inspect delay and to
28
--  condition its execution with an ACL relying on such information.
29
-+  are present when the rule is processed. The rule processing engine is able to
30
-+  wait until the inspect delay expires when the data to be tracked is not yet
31
-+  available.
32
- 
33
-   Example:
34
-         # Accept HTTP requests containing a Host header saying "example.com"
35
-@@ -7497,12 +7497,12 @@ tcp-request content <action> [{if | unless} <condition>]
36
-   Example:
37
-         # Track the last IP from X-Forwarded-For
38
-         tcp-request inspect-delay 10s
39
--        tcp-request content track-sc0 hdr(x-forwarded-for,-1) if HTTP
40
-+        tcp-request content track-sc0 hdr(x-forwarded-for,-1)
41
- 
42
-   Example:
43
-         # track request counts per "base" (concatenation of Host+URL)
44
-         tcp-request inspect-delay 10s
45
--        tcp-request content track-sc0 base table req-rate if HTTP
46
-+        tcp-request content track-sc0 base table req-rate
47
- 
48
-   Example: track per-frontend and per-backend counters, block abusers at the
49
-            frontend when the backend detects abuse.
50
-1.8.5.5
51
-

+ 0
- 79
net/haproxy/patches/0006-MEDIUM-http-enable-header-manipulation-for-101-respo.patch View File

@@ -1,80 +0,0 @@
1
-From 0cb4b899d370b9d04b3457a1d75dbd658c1a1646 Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Tue, 16 Sep 2014 10:40:38 +0200
4
-Subject: [PATCH 06/13] MEDIUM: http: enable header manipulation for 101
5
- responses
6
-
7
-Ryan Brock reported that server stickiness did not work for WebSocket
8
-because the cookies and headers are not modified on 1xx responses. He
9
-found that his browser correctly presents the cookies learned on 101
10
-responses, which was not specifically defined in the WebSocket spec,
11
-nor in the cookie spec. 101 is a very special case. Being part of 1xx,
12
-it's an interim response. But within 1xx, it's special because it's
13
-the last HTTP/1 response that transits on the wire, which is different
14
-from 100 or 102 which may appear multiple times. So in that sense, we
15
-can consider it as a final response regarding HTTP/1, and it makes
16
-sense to allow header processing there. Note that we still ensure not
17
-to mangle the Connection header, which is critical for HTTP upgrade to
18
-continue to work smoothly with agents that are a bit picky about what
19
-tokens are found there.
20
-
21
-The rspadd rules are now processed for 101 responses as well, but the
22
-cache-control checks are not performed (since no body is delivered).
23
-
24
-Ryan confirmed that this patch works for him.
25
-
26
-It would make sense to backport it to 1.5 given that it improves end
27
-user experience on WebSocket servers.
28
-(cherry picked from commit ce730de86719d0b5079dd8b0843559e4ff0a1ecc)
29
----
30
- src/proto_http.c | 12 +++++++-----
31
- 1 file changed, 7 insertions(+), 5 deletions(-)
32
-
33
-diff --git a/src/proto_http.c b/src/proto_http.c
34
-index 4d27b2c..7e35c8b 100644
35
---- a/src/proto_http.c
36
-+++ b/src/proto_http.c
37
-@@ -6249,7 +6249,7 @@ int http_process_res_common(struct session *s, struct channel *rep, int an_bit,
38
- 
39
- 		/* add response headers from the rule sets in the same order */
40
- 		list_for_each_entry(wl, &rule_set->rsp_add, list) {
41
--			if (txn->status < 200)
42
-+			if (txn->status < 200 && txn->status != 101)
43
- 				break;
44
- 			if (wl->cond) {
45
- 				int ret = acl_exec_cond(wl->cond, px, s, txn, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
46
-@@ -6270,7 +6270,7 @@ int http_process_res_common(struct session *s, struct channel *rep, int an_bit,
47
- 	}
48
- 
49
- 	/* OK that's all we can do for 1xx responses */
50
--	if (unlikely(txn->status < 200))
51
-+	if (unlikely(txn->status < 200 && txn->status != 101))
52
- 		goto skip_header_mangling;
53
- 
54
- 	/*
55
-@@ -6283,7 +6283,7 @@ int http_process_res_common(struct session *s, struct channel *rep, int an_bit,
56
- 	/*
57
- 	 * Check for cache-control or pragma headers if required.
58
- 	 */
59
--	if ((s->be->options & PR_O_CHK_CACHE) || (s->be->ck_opts & PR_CK_NOC))
60
-+	if (((s->be->options & PR_O_CHK_CACHE) || (s->be->ck_opts & PR_CK_NOC)) && txn->status != 101)
61
- 		check_response_for_cacheability(s, rep);
62
- 
63
- 	/*
64
-@@ -6399,9 +6399,11 @@ int http_process_res_common(struct session *s, struct channel *rep, int an_bit,
65
- 	 * Adjust "Connection: close" or "Connection: keep-alive" if needed.
66
- 	 * If an "Upgrade" token is found, the header is left untouched in order
67
- 	 * not to have to deal with some client bugs : some of them fail an upgrade
68
--	 * if anything but "Upgrade" is present in the Connection header.
69
-+	 * if anything but "Upgrade" is present in the Connection header. We don't
70
-+	 * want to touch any 101 response either since it's switching to another
71
-+	 * protocol.
72
- 	 */
73
--	if (!(txn->flags & TX_HDR_CONN_UPG) &&
74
-+	if ((txn->status != 101) && !(txn->flags & TX_HDR_CONN_UPG) &&
75
- 	    (((txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_TUN) ||
76
- 	     ((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL ||
77
- 	      (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL))) {
78
-1.8.5.5
79
-

+ 0
- 59
net/haproxy/patches/0007-BUG-MEDIUM-config-propagate-frontend-to-backend-proc.patch View File

@@ -1,60 +0,0 @@
1
-From b53934eec71ab34eb3762a89cec326360a5b0bc5 Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Tue, 16 Sep 2014 11:31:31 +0200
4
-Subject: [PATCH 07/13] BUG/MEDIUM: config: propagate frontend to backend
5
- process binding again.
6
-
7
-This basically reverts 3507d5d ("MEDIUM: proxy: only adjust the backend's
8
-bind-process when already set"). It was needed during the transition to
9
-the new process binding method but is causing trouble now because frontend
10
-to backend binding is not properly propagated.
11
-
12
-This fix should be backported to 1.5.
13
-(cherry picked from commit 8a3478ed31a16904f45178c153f4649faf6de675)
14
----
15
- src/cfgparse.c | 15 ++++++---------
16
- 1 file changed, 6 insertions(+), 9 deletions(-)
17
-
18
-diff --git a/src/cfgparse.c b/src/cfgparse.c
19
-index 943eba0..5288600 100644
20
---- a/src/cfgparse.c
21
-+++ b/src/cfgparse.c
22
-@@ -6165,9 +6165,8 @@ int check_config_validity()
23
- 				/* we force the backend to be present on at least all of
24
- 				 * the frontend's processes.
25
- 				 */
26
--				if (target->bind_proc)
27
--					target->bind_proc = curproxy->bind_proc ?
28
--						(target->bind_proc | curproxy->bind_proc) : 0;
29
-+				target->bind_proc = curproxy->bind_proc ?
30
-+					(target->bind_proc | curproxy->bind_proc) : 0;
31
- 
32
- 				/* Emit a warning if this proxy also has some servers */
33
- 				if (curproxy->srv) {
34
-@@ -6203,9 +6202,8 @@ int check_config_validity()
35
- 					/* we force the backend to be present on at least all of
36
- 					 * the frontend's processes.
37
- 					 */
38
--					if (target->bind_proc)
39
--						target->bind_proc = curproxy->bind_proc ?
40
--							(target->bind_proc | curproxy->bind_proc) : 0;
41
-+					target->bind_proc = curproxy->bind_proc ?
42
-+						(target->bind_proc | curproxy->bind_proc) : 0;
43
- 				}
44
- 			}
45
- 		}
46
-@@ -6257,9 +6255,8 @@ int check_config_validity()
47
- 				/* we force the backend to be present on at least all of
48
- 				 * the frontend's processes.
49
- 				 */
50
--				if (target->bind_proc)
51
--					target->bind_proc = curproxy->bind_proc ?
52
--						(target->bind_proc | curproxy->bind_proc) : 0;
53
-+				target->bind_proc = curproxy->bind_proc ?
54
-+					(target->bind_proc | curproxy->bind_proc) : 0;
55
- 			}
56
- 		}
57
- 
58
-1.8.5.5
59
-

+ 0
- 141
net/haproxy/patches/0008-MEDIUM-config-properly-propagate-process-binding-bet.patch View File

@@ -1,142 +0,0 @@
1
-From 5436afc9488531a5e2adff3a1a766af375e0922c Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Tue, 16 Sep 2014 12:17:36 +0200
4
-Subject: [PATCH 08/13] MEDIUM: config: properly propagate process binding
5
- between proxies
6
-
7
-We now recursively propagate the bind-process values between frontends
8
-and backends instead of doing it during name resolving. This ensures
9
-that we're able to properly propagate all the bind-process directives
10
-even across "listen" instances, which are not perfectly covered at the
11
-moment, depending on the declaration order.
12
-(cherry picked from commit 64ab6077b768ee02b04a36b30ee195639a2fabc1)
13
----
14
- src/cfgparse.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++------------
15
- 1 file changed, 65 insertions(+), 16 deletions(-)
16
-
17
-diff --git a/src/cfgparse.c b/src/cfgparse.c
18
-index 5288600..b9853ef 100644
19
---- a/src/cfgparse.c
20
-+++ b/src/cfgparse.c
21
-@@ -5932,6 +5932,64 @@ int readcfgfile(const char *file)
22
- 	return err_code;
23
- }
24
- 
25
-+/* This function propagates processes from frontend <from> to backend <to> so
26
-+ * that it is always guaranteed that a backend pointed to by a frontend is
27
-+ * bound to all of its processes. After that, if the target is a "listen"
28
-+ * instance, the function recursively descends the target's own targets along
29
-+ * default_backend, use_backend rules, and reqsetbe rules. Since the bits are
30
-+ * checked first to ensure that <to> is already bound to all processes of
31
-+ * <from>, there is no risk of looping and we ensure to follow the shortest
32
-+ * path to the destination.
33
-+ *
34
-+ * It is possible to set <to> to NULL for the first call so that the function
35
-+ * takes care of visiting the initial frontend in <from>.
36
-+ *
37
-+ * It is important to note that the function relies on the fact that all names
38
-+ * have already been resolved.
39
-+ */
40
-+void propagate_processes(struct proxy *from, struct proxy *to)
41
-+{
42
-+	struct switching_rule *rule;
43
-+	struct hdr_exp *exp;
44
-+
45
-+	if (to) {
46
-+		/* check whether we need to go down */
47
-+		if (from->bind_proc &&
48
-+		    (from->bind_proc & to->bind_proc) == from->bind_proc)
49
-+			return;
50
-+
51
-+		if (!from->bind_proc && !to->bind_proc)
52
-+			return;
53
-+
54
-+		to->bind_proc = from->bind_proc ?
55
-+			(to->bind_proc | from->bind_proc) : 0;
56
-+
57
-+		/* now propagate down */
58
-+		from = to;
59
-+	}
60
-+
61
-+	if (!from->cap & PR_CAP_FE)
62
-+		return;
63
-+
64
-+	/* default_backend */
65
-+	if (from->defbe.be)
66
-+		propagate_processes(from, from->defbe.be);
67
-+
68
-+	/* use_backend */
69
-+	list_for_each_entry(rule, &from->switching_rules, list) {
70
-+		to = rule->be.backend;
71
-+		propagate_processes(from, to);
72
-+	}
73
-+
74
-+	/* reqsetbe */
75
-+	for (exp = from->req_exp; exp != NULL; exp = exp->next) {
76
-+		if (exp->action != ACT_SETBE)
77
-+			continue;
78
-+		to = (struct proxy *)exp->replace;
79
-+		propagate_processes(from, to);
80
-+	}
81
-+}
82
-+
83
- /*
84
-  * Returns the error code, 0 if OK, or any combination of :
85
-  *  - ERR_ABORT: must abort ASAP
86
-@@ -6162,11 +6220,6 @@ int check_config_validity()
87
- 			} else {
88
- 				free(curproxy->defbe.name);
89
- 				curproxy->defbe.be = target;
90
--				/* we force the backend to be present on at least all of
91
--				 * the frontend's processes.
92
--				 */
93
--				target->bind_proc = curproxy->bind_proc ?
94
--					(target->bind_proc | curproxy->bind_proc) : 0;
95
- 
96
- 				/* Emit a warning if this proxy also has some servers */
97
- 				if (curproxy->srv) {
98
-@@ -6199,11 +6252,6 @@ int check_config_validity()
99
- 				} else {
100
- 					free((void *)exp->replace);
101
- 					exp->replace = (const char *)target;
102
--					/* we force the backend to be present on at least all of
103
--					 * the frontend's processes.
104
--					 */
105
--					target->bind_proc = curproxy->bind_proc ?
106
--						(target->bind_proc | curproxy->bind_proc) : 0;
107
- 				}
108
- 			}
109
- 		}
110
-@@ -6252,15 +6300,10 @@ int check_config_validity()
111
- 			} else {
112
- 				free((void *)rule->be.name);
113
- 				rule->be.backend = target;
114
--				/* we force the backend to be present on at least all of
115
--				 * the frontend's processes.
116
--				 */
117
--				target->bind_proc = curproxy->bind_proc ?
118
--					(target->bind_proc | curproxy->bind_proc) : 0;
119
- 			}
120
- 		}
121
- 
122
--		/* find the target proxy for 'use_backend' rules */
123
-+		/* find the target server for 'use_server' rules */
124
- 		list_for_each_entry(srule, &curproxy->server_rules, list) {
125
- 			struct server *target = findserver(curproxy, srule->srv.name);
126
- 
127
-@@ -7131,6 +7174,12 @@ out_uri_auth_compat:
128
- 		}
129
- 	}
130
- 
131
-+	/* At this point, target names have already been resolved */
132
-+	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
133
-+		if (curproxy->cap & PR_CAP_FE)
134
-+			propagate_processes(curproxy, NULL);
135
-+	}
136
-+
137
- 	/* automatically compute fullconn if not set. We must not do it in the
138
- 	 * loop above because cross-references are not yet fully resolved.
139
- 	 */
140
-1.8.5.5
141
-

+ 0
- 92
net/haproxy/patches/0009-MEDIUM-config-make-the-frontends-automatically-bind-.patch View File

@@ -1,93 +0,0 @@
1
-From e56c4f1f76c6731a5a0f4b128540071cffeb1951 Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Tue, 16 Sep 2014 13:21:03 +0200
4
-Subject: [PATCH 09/13] MEDIUM: config: make the frontends automatically bind
5
- to the listeners' processes
6
-
7
-When a frontend does not have any bind-process directive, make it
8
-automatically bind to the union of all of its listeners' processes
9
-instead of binding to all processes. That will make it possible to
10
-have the expected behaviour without having to explicitly specify a
11
-bind-process directive.
12
-
13
-Note that if the listeners are not bound to a specific process, the
14
-default is still to bind to all processes.
15
-
16
-This change could be backported to 1.5 as it simplifies process
17
-management, and was planned to be done during the 1.5 development phase.
18
-(cherry picked from commit b369a045d545b41ef2b250bf747caf83c97e0ca8)
19
----
20
- doc/configuration.txt |  4 ++++
21
- src/cfgparse.c        | 36 ++++++++++++++++++++++++++++++++++++
22
- 2 files changed, 40 insertions(+)
23
-
24
-diff --git a/doc/configuration.txt b/doc/configuration.txt
25
-index 3c75c92..1e32057 100644
26
---- a/doc/configuration.txt
27
-+++ b/doc/configuration.txt
28
-@@ -1905,6 +1905,10 @@ bind-process [ all | odd | even | <number 1-64>[-<number 1-64>] ] ...
29
-   Each "bind" line may further be limited to a subset of the proxy's processes,
30
-   please consult the "process" bind keyword in section 5.1.
31
- 
32
-+  When a frontend has no explicit "bind-process" line, it tries to bind to all
33
-+  the processes referenced by its "bind" lines. That means that frontends can
34
-+  easily adapt to their listeners' processes.
35
-+
36
-   If some backends are referenced by frontends bound to other processes, the
37
-   backend automatically inherits the frontend's processes.
38
- 
39
-diff --git a/src/cfgparse.c b/src/cfgparse.c
40
-index b9853ef..d53f69e 100644
41
---- a/src/cfgparse.c
42
-+++ b/src/cfgparse.c
43
-@@ -7175,11 +7175,47 @@ out_uri_auth_compat:
44
- 	}
45
- 
46
- 	/* At this point, target names have already been resolved */
47
-+
48
-+	/* Make each frontend inherit bind-process from its listeners when not specified. */
49
-+	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
50
-+		if (curproxy->bind_proc)
51
-+			continue;
52
-+
53
-+		list_for_each_entry(bind_conf, &curproxy->conf.bind, by_fe) {
54
-+			unsigned long mask;
55
-+
56
-+			mask = bind_conf->bind_proc ? bind_conf->bind_proc : ~0UL;
57
-+			curproxy->bind_proc |= mask;
58
-+		}
59
-+
60
-+		if (!curproxy->bind_proc)
61
-+			curproxy->bind_proc = ~0UL;
62
-+	}
63
-+
64
-+	if (global.stats_fe) {
65
-+		list_for_each_entry(bind_conf, &global.stats_fe->conf.bind, by_fe) {
66
-+			unsigned long mask;
67
-+
68
-+			mask = bind_conf->bind_proc ? bind_conf->bind_proc : ~0UL;
69
-+			global.stats_fe->bind_proc |= mask;
70
-+		}
71
-+		if (!global.stats_fe->bind_proc)
72
-+			global.stats_fe->bind_proc = ~0UL;
73
-+	}
74
-+
75
-+	/* propagate bindings from frontends to backends */
76
- 	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
77
- 		if (curproxy->cap & PR_CAP_FE)
78
- 			propagate_processes(curproxy, NULL);
79
- 	}
80
- 
81
-+	/* Bind each unbound backend to all processes when not specified. */
82
-+	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
83
-+		if (curproxy->bind_proc)
84
-+			continue;
85
-+		curproxy->bind_proc = ~0UL;
86
-+	}
87
-+
88
- 	/* automatically compute fullconn if not set. We must not do it in the
89
- 	 * loop above because cross-references are not yet fully resolved.
90
- 	 */
91
-1.8.5.5
92
-

+ 0
- 208
net/haproxy/patches/0010-MEDIUM-config-compute-the-exact-bind-process-before-.patch View File

@@ -1,209 +0,0 @@
1
-From 91b00c2194b728ccd61133cca83f03de3650b674 Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Tue, 16 Sep 2014 13:41:21 +0200
4
-Subject: [PATCH 10/13] MEDIUM: config: compute the exact bind-process before
5
- listener's maxaccept
6
-
7
-This is a continuation of previous patch, the listener's maxaccept is divided
8
-by the number of processes, so it's best if we can swap the two blocks so that
9
-the number of processes is already known when computing the maxaccept value.
10
-(cherry picked from commit 419ead8eca9237f9cc2ec32630d96fde333282ee)
11
----
12
- src/cfgparse.c | 156 ++++++++++++++++++++++++++++++---------------------------
13
- 1 file changed, 81 insertions(+), 75 deletions(-)
14
-
15
-diff --git a/src/cfgparse.c b/src/cfgparse.c
16
-index d53f69e..f3907bf 100644
17
---- a/src/cfgparse.c
18
-+++ b/src/cfgparse.c
19
-@@ -6042,12 +6042,11 @@ int check_config_validity()
20
- 		proxy = next;
21
- 	}
22
- 
23
--	while (curproxy != NULL) {
24
-+	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
25
- 		struct switching_rule *rule;
26
- 		struct server_rule *srule;
27
- 		struct sticking_rule *mrule;
28
- 		struct tcp_rule *trule;
29
--		struct listener *listener;
30
- 		unsigned int next_id;
31
- 		int nbproc;
32
- 
33
-@@ -6115,14 +6114,6 @@ int check_config_validity()
34
- 			}
35
- 		}
36
- 
37
--		/* here, if bind_proc is null, it means no limit, otherwise it's explicit.
38
--		 * We now check how many processes the proxy will effectively run on.
39
--		 */
40
--
41
--		nbproc = global.nbproc;
42
--		if (curproxy->bind_proc)
43
--			nbproc = popcount(curproxy->bind_proc & nbits(global.nbproc));
44
--
45
- 		if (global.nbproc > 1 && curproxy->table.peers.name) {
46
- 			Alert("Proxy '%s': peers can't be used in multi-process mode (nbproc > 1).\n",
47
- 			      curproxy->id);
48
-@@ -7005,6 +6996,86 @@ out_uri_auth_compat:
49
- 			if (curproxy->options2 & PR_O2_RDPC_PRST)
50
- 				curproxy->be_req_ana |= AN_REQ_PRST_RDP_COOKIE;
51
- 		}
52
-+	}
53
-+
54
-+	/***********************************************************/
55
-+	/* At this point, target names have already been resolved. */
56
-+	/***********************************************************/
57
-+
58
-+	/* Check multi-process mode compatibility */
59
-+
60
-+	if (global.nbproc > 1 && global.stats_fe) {
61
-+		list_for_each_entry(bind_conf, &global.stats_fe->conf.bind, by_fe) {
62
-+			unsigned long mask;
63
-+
64
-+			mask = nbits(global.nbproc);
65
-+			if (global.stats_fe->bind_proc)
66
-+				mask &= global.stats_fe->bind_proc;
67
-+
68
-+			if (bind_conf->bind_proc)
69
-+				mask &= bind_conf->bind_proc;
70
-+
71
-+			/* stop here if more than one process is used */
72
-+			if (popcount(mask) > 1)
73
-+				break;
74
-+		}
75
-+		if (&bind_conf->by_fe != &global.stats_fe->conf.bind) {
76
-+			Warning("stats socket will not work as expected in multi-process mode (nbproc > 1), you should force process binding globally using 'stats bind-process' or per socket using the 'process' attribute.\n");
77
-+		}
78
-+	}
79
-+
80
-+	/* Make each frontend inherit bind-process from its listeners when not specified. */
81
-+	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
82
-+		if (curproxy->bind_proc)
83
-+			continue;
84
-+
85
-+		list_for_each_entry(bind_conf, &curproxy->conf.bind, by_fe) {
86
-+			unsigned long mask;
87
-+
88
-+			mask = bind_conf->bind_proc ? bind_conf->bind_proc : ~0UL;
89
-+			curproxy->bind_proc |= mask;
90
-+		}
91
-+
92
-+		if (!curproxy->bind_proc)
93
-+			curproxy->bind_proc = ~0UL;
94
-+	}
95
-+
96
-+	if (global.stats_fe) {
97
-+		list_for_each_entry(bind_conf, &global.stats_fe->conf.bind, by_fe) {
98
-+			unsigned long mask;
99
-+
100
-+			mask = bind_conf->bind_proc ? bind_conf->bind_proc : ~0UL;
101
-+			global.stats_fe->bind_proc |= mask;
102
-+		}
103
-+		if (!global.stats_fe->bind_proc)
104
-+			global.stats_fe->bind_proc = ~0UL;
105
-+	}
106
-+
107
-+	/* propagate bindings from frontends to backends */
108
-+	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
109
-+		if (curproxy->cap & PR_CAP_FE)
110
-+			propagate_processes(curproxy, NULL);
111
-+	}
112
-+
113
-+	/* Bind each unbound backend to all processes when not specified. */
114
-+	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
115
-+		if (curproxy->bind_proc)
116
-+			continue;
117
-+		curproxy->bind_proc = ~0UL;
118
-+	}
119
-+
120
-+	/*******************************************************/
121
-+	/* At this step, all proxies have a non-null bind_proc */
122
-+	/*******************************************************/
123
-+
124
-+	/* perform the final checks before creating tasks */
125
-+
126
-+	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
127
-+		struct listener *listener;
128
-+		unsigned int next_id;
129
-+		int nbproc;
130
-+
131
-+		nbproc = popcount(curproxy->bind_proc & nbits(global.nbproc));
132
- 
133
- #ifdef USE_OPENSSL
134
- 		/* Configure SSL for each bind line.
135
-@@ -7149,71 +7220,6 @@ out_uri_auth_compat:
136
- 			      curproxy->id);
137
- 			cfgerr++;
138
- 		}
139
--
140
--		curproxy = curproxy->next;
141
--	}
142
--
143
--	/* Check multi-process mode compatibility */
144
--	if (global.nbproc > 1 && global.stats_fe) {
145
--		list_for_each_entry(bind_conf, &global.stats_fe->conf.bind, by_fe) {
146
--			unsigned long mask;
147
--
148
--			mask = nbits(global.nbproc);
149
--			if (global.stats_fe->bind_proc)
150
--				mask &= global.stats_fe->bind_proc;
151
--
152
--			if (bind_conf->bind_proc)
153
--				mask &= bind_conf->bind_proc;
154
--
155
--			/* stop here if more than one process is used */
156
--			if (popcount(mask) > 1)
157
--				break;
158
--		}
159
--		if (&bind_conf->by_fe != &global.stats_fe->conf.bind) {
160
--			Warning("stats socket will not work as expected in multi-process mode (nbproc > 1), you should force process binding globally using 'stats bind-process' or per socket using the 'process' attribute.\n");
161
--		}
162
--	}
163
--
164
--	/* At this point, target names have already been resolved */
165
--
166
--	/* Make each frontend inherit bind-process from its listeners when not specified. */
167
--	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
168
--		if (curproxy->bind_proc)
169
--			continue;
170
--
171
--		list_for_each_entry(bind_conf, &curproxy->conf.bind, by_fe) {
172
--			unsigned long mask;
173
--
174
--			mask = bind_conf->bind_proc ? bind_conf->bind_proc : ~0UL;
175
--			curproxy->bind_proc |= mask;
176
--		}
177
--
178
--		if (!curproxy->bind_proc)
179
--			curproxy->bind_proc = ~0UL;
180
--	}
181
--
182
--	if (global.stats_fe) {
183
--		list_for_each_entry(bind_conf, &global.stats_fe->conf.bind, by_fe) {
184
--			unsigned long mask;
185
--
186
--			mask = bind_conf->bind_proc ? bind_conf->bind_proc : ~0UL;
187
--			global.stats_fe->bind_proc |= mask;
188
--		}
189
--		if (!global.stats_fe->bind_proc)
190
--			global.stats_fe->bind_proc = ~0UL;
191
--	}
192
--
193
--	/* propagate bindings from frontends to backends */
194
--	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
195
--		if (curproxy->cap & PR_CAP_FE)
196
--			propagate_processes(curproxy, NULL);
197
--	}
198
--
199
--	/* Bind each unbound backend to all processes when not specified. */
200
--	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
201
--		if (curproxy->bind_proc)
202
--			continue;
203
--		curproxy->bind_proc = ~0UL;
204
- 	}
205
- 
206
- 	/* automatically compute fullconn if not set. We must not do it in the
207
-1.8.5.5
208
-

+ 0
- 44
net/haproxy/patches/0011-MEDIUM-config-only-warn-if-stats-are-attached-to-mul.patch View File

@@ -1,45 +0,0 @@
1
-From 036a83e9c300a42386cd378022420e52a43b314f Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Tue, 16 Sep 2014 15:11:04 +0200
4
-Subject: [PATCH 11/13] MEDIUM: config: only warn if stats are attached to
5
- multi-process bind directives
6
-
7
-Some users want to have a stats frontend with one line per process, but while
8
-100% valid and safe, the config parser emits a warning. Relax this check to
9
-ensure that the warning is only emitted if at least one of the listeners is
10
-bound to multiple processes, or if the directive is placed in a backend called
11
-from multiple processes (since in this case we don't know if it's safe).
12
-(cherry picked from commit eb791e03b5c5abfddb24a439fa6434788db026b7)
13
----
14
- src/cfgparse.c | 15 +++++++++++++--
15
- 1 file changed, 13 insertions(+), 2 deletions(-)
16
-
17
-diff --git a/src/cfgparse.c b/src/cfgparse.c
18
-index f3907bf..5668393 100644
19
---- a/src/cfgparse.c
20
-+++ b/src/cfgparse.c
21
-@@ -7189,8 +7189,19 @@ out_uri_auth_compat:
22
- 
23
- 		if (nbproc > 1) {
24
- 			if (curproxy->uri_auth) {
25
--				Warning("Proxy '%s': in multi-process mode, stats will be limited to process assigned to the current request.\n",
26
--				        curproxy->id);
27
-+				int count, maxproc = 0;
28
-+
29
-+				list_for_each_entry(bind_conf, &curproxy->conf.bind, by_fe) {
30
-+					count = popcount(bind_conf->bind_proc);
31
-+					if (count > maxproc)
32
-+						maxproc = count;
33
-+				}
34
-+				/* backends have 0, frontends have 1 or more */
35
-+				if (maxproc != 1)
36
-+					Warning("Proxy '%s': in multi-process mode, stats will be"
37
-+					        " limited to process assigned to the current request.\n",
38
-+					        curproxy->id);
39
-+
40
- 				if (!LIST_ISEMPTY(&curproxy->uri_auth->admin_rules)) {
41
- 					Warning("Proxy '%s': stats admin will not work correctly in multi-process mode.\n",
42
- 					        curproxy->id);
43
-1.8.5.5
44
-

+ 0
- 109
net/haproxy/patches/0012-MEDIUM-config-report-it-when-tcp-request-rules-are-m.patch View File

@@ -1,110 +0,0 @@
1
-From 8b3c808c37dd5672f87e7b61085295e1316a6694 Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Tue, 16 Sep 2014 15:39:51 +0200
4
-Subject: [PATCH 12/13] MEDIUM: config: report it when tcp-request rules are
5
- misplaced
6
-
7
-A config where a tcp-request rule appears after an http-request rule
8
-might seem valid but it is not. So let's report a warning about this
9
-since this case is hard to detect by the naked eye.
10
-(cherry picked from commit 3986b9c14037f446f5f5bec6207a39e1bd753fae)
11
----
12
- include/common/cfgparse.h |  2 ++
13
- src/cfgparse.c            | 38 ++++++++++++++++++++++++++++++++++++++
14
- src/proto_tcp.c           |  4 ++++
15
- 3 files changed, 44 insertions(+)
16
-
17
-diff --git a/include/common/cfgparse.h b/include/common/cfgparse.h
18
-index 80310ae..86a0035 100644
19
---- a/include/common/cfgparse.h
20
-+++ b/include/common/cfgparse.h
21
-@@ -73,6 +73,8 @@ int check_config_validity();
22
- int str2listener(char *str, struct proxy *curproxy, struct bind_conf *bind_conf, const char *file, int line, char **err);
23
- int cfg_register_section(char *section_name,
24
-                          int (*section_parser)(const char *, int, char **, int));
25
-+int warnif_misplaced_tcp_conn(struct proxy *proxy, const char *file, int line, const char *arg);
26
-+int warnif_misplaced_tcp_cont(struct proxy *proxy, const char *file, int line, const char *arg);
27
- 
28
- /*
29
-  * Sends a warning if proxy <proxy> does not have at least one of the
30
-diff --git a/src/cfgparse.c b/src/cfgparse.c
31
-index 5668393..9ff44e9 100644
32
---- a/src/cfgparse.c
33
-+++ b/src/cfgparse.c
34
-@@ -317,6 +317,19 @@ int str2listener(char *str, struct proxy *curproxy, struct bind_conf *bind_conf,
35
- 	return 0;
36
- }
37
- 
38
-+/* Report a warning if a rule is placed after a 'tcp-request content' rule.
39
-+ * Return 1 if the warning has been emitted, otherwise 0.
40
-+ */
41
-+int warnif_rule_after_tcp_cont(struct proxy *proxy, const char *file, int line, const char *arg)
42
-+{
43
-+	if (!LIST_ISEMPTY(&proxy->tcp_req.inspect_rules)) {
44
-+		Warning("parsing [%s:%d] : a '%s' rule placed after a 'tcp-request content' rule will still be processed before.\n",
45
-+			file, line, arg);
46
-+		return 1;
47
-+	}
48
-+	return 0;
49
-+}
50
-+
51
- /* Report a warning if a rule is placed after a 'block' rule.
52
-  * Return 1 if the warning has been emitted, otherwise 0.
53
-  */
54
-@@ -408,6 +421,31 @@ int warnif_rule_after_use_server(struct proxy *proxy, const char *file, int line
55
- 	return 0;
56
- }
57
- 
58
-+/* report a warning if a "tcp request connection" rule is dangerously placed */
59
-+int warnif_misplaced_tcp_conn(struct proxy *proxy, const char *file, int line, const char *arg)
60
-+{
61
-+	return	warnif_rule_after_tcp_cont(proxy, file, line, arg) ||
62
-+		warnif_rule_after_block(proxy, file, line, arg) ||
63
-+		warnif_rule_after_http_req(proxy, file, line, arg) ||
64
-+		warnif_rule_after_reqxxx(proxy, file, line, arg) ||
65
-+		warnif_rule_after_reqadd(proxy, file, line, arg) ||
66
-+		warnif_rule_after_redirect(proxy, file, line, arg) ||
67
-+		warnif_rule_after_use_backend(proxy, file, line, arg) ||
68
-+		warnif_rule_after_use_server(proxy, file, line, arg);
69
-+}
70
-+
71
-+/* report a warning if a "tcp request content" rule is dangerously placed */
72
-+int warnif_misplaced_tcp_cont(struct proxy *proxy, const char *file, int line, const char *arg)
73
-+{
74
-+	return	warnif_rule_after_block(proxy, file, line, arg) ||
75
-+		warnif_rule_after_http_req(proxy, file, line, arg) ||
76
-+		warnif_rule_after_reqxxx(proxy, file, line, arg) ||
77
-+		warnif_rule_after_reqadd(proxy, file, line, arg) ||
78
-+		warnif_rule_after_redirect(proxy, file, line, arg) ||
79
-+		warnif_rule_after_use_backend(proxy, file, line, arg) ||
80
-+		warnif_rule_after_use_server(proxy, file, line, arg);
81
-+}
82
-+
83
- /* report a warning if a block rule is dangerously placed */
84
- int warnif_misplaced_block(struct proxy *proxy, const char *file, int line, const char *arg)
85
- {
86
-diff --git a/src/proto_tcp.c b/src/proto_tcp.c
87
-index 72dc92b..940c3f1 100644
88
---- a/src/proto_tcp.c
89
-+++ b/src/proto_tcp.c
90
-@@ -1711,6 +1711,8 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
91
- 			warn++;
92
- 		}
93
- 
94
-+		/* the following function directly emits the warning */
95
-+		warnif_misplaced_tcp_cont(curpx, file, line, args[0]);
96
- 		LIST_ADDQ(&curpx->tcp_req.inspect_rules, &rule->list);
97
- 	}
98
- 	else if (strcmp(args[1], "connection") == 0) {
99
-@@ -1754,6 +1756,8 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
100
- 			warn++;
101
- 		}
102
- 
103
-+		/* the following function directly emits the warning */
104
-+		warnif_misplaced_tcp_conn(curpx, file, line, args[0]);
105
- 		LIST_ADDQ(&curpx->tcp_req.l4_rules, &rule->list);
106
- 	}
107
- 	else {
108
-1.8.5.5
109
-

+ 0
- 51
net/haproxy/patches/0013-MINOR-config-detect-the-case-where-a-tcp-request-con.patch View File

@@ -1,52 +0,0 @@
1
-From 7fc7ebd5785629074297ee324b22e0aee9ad00f9 Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Tue, 16 Sep 2014 16:21:19 +0200
4
-Subject: [PATCH 13/13] MINOR: config: detect the case where a tcp-request
5
- content rule has no inspect-delay
6
-
7
-If a frontend has any tcp-request content rule relying on request contents
8
-without any inspect delay, we now emit a warning as this will randomly match.
9
-
10
-This can be backported to 1.5 as it reduces the support effort.
11
-(cherry picked from commit e42bd96d0acc38ea7c546c8de8115ffd1dd6c3f3)
12
----
13
- src/cfgparse.c | 23 +++++++++++++++++++++++
14
- 1 file changed, 23 insertions(+)
15
-
16
-diff --git a/src/cfgparse.c b/src/cfgparse.c
17
-index 9ff44e9..f723a3a 100644
18
---- a/src/cfgparse.c
19
-+++ b/src/cfgparse.c
20
-@@ -6998,6 +6998,29 @@ out_uri_auth_compat:
21
- 			newsrv = newsrv->next;
22
- 		}
23
- 
24
-+		/* check if we have a frontend with "tcp-request content" looking at L7
25
-+		 * with no inspect-delay
26
-+		 */
27
-+		if ((curproxy->cap & PR_CAP_FE) && !curproxy->tcp_req.inspect_delay) {
28
-+			list_for_each_entry(trule, &curproxy->tcp_req.inspect_rules, list) {
29
-+				if (trule->action == TCP_ACT_CAPTURE &&
30
-+				    !(trule->act_prm.cap.expr->fetch->val & SMP_VAL_FE_SES_ACC))
31
-+					break;
32
-+				if  ((trule->action >= TCP_ACT_TRK_SC0 && trule->action <= TCP_ACT_TRK_SCMAX) &&
33
-+				     !(trule->act_prm.trk_ctr.expr->fetch->val & SMP_VAL_FE_SES_ACC))
34
-+					break;
35
-+			}
36
-+
37
-+			if (&trule->list != &curproxy->tcp_req.inspect_rules) {
38
-+				Warning("config : %s '%s' : some 'tcp-request content' rules explicitly depending on request"
39
-+				        " contents were found in a frontend without any 'tcp-request inspect-delay' setting."
40
-+				        " This means that these rules will randomly find their contents. This can be fixed by"
41
-+					" setting the tcp-request inspect-delay.\n",
42
-+				        proxy_type_str(curproxy), curproxy->id);
43
-+				err_code |= ERR_WARN;
44
-+			}
45
-+		}
46
-+
47
- 		if (curproxy->cap & PR_CAP_FE) {
48
- 			if (!curproxy->accept)
49
- 				curproxy->accept = frontend_accept;
50
-1.8.5.5
51
-

+ 0
- 89
net/haproxy/patches/0014-MEDIUM-systemd-wrapper-support-multiple-executable-v.patch View File

@@ -1,90 +0,0 @@
1
-From afbfc27c0f2cac29e18f87b36335ea821c633b9d Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Fri, 19 Sep 2014 15:42:30 +0200
4
-Subject: [PATCH 14/14] MEDIUM: systemd-wrapper: support multiple executable
5
- versions and names
6
-
7
-Having to use a hard-coded "haproxy" executable name next to the systemd
8
-wrapper is not always convenient, as it's sometimes desirable to run with
9
-multiple versions in parallel.
10
-
11
-Thus this patch performs a minor change to the wrapper : if the name ends
12
-with "-systemd-wrapper", then it trims that part off and what remains
13
-becomes the target haproxy executable. That makes it easy to have for
14
-example :
15
-
16
-     haproxy-1.5.4-systemd-wrapper      haproxy-1.5.4
17
-     haproxy-1.5.3-systemd-wrapper      haproxy-1.5.3
18
-
19
-and so on, in a same directory.
20
-
21
-This patch also fixes a rare bug caused by readlink() not adding the
22
-trailing zero and leaving possible existing contents, including possibly
23
-a randomly placed "/" which would make it unable to locate the correct
24
-binary. This case is not totally unlikely as I got a \177 a few times
25
-at the end of the executable names, so I could have got a '/' as well.
26
-
27
-Back-porting to 1.5 is desirable.
28
-(cherry picked from commit ceaf2aec1ec1612da461c61798e944693144bee9)
29
----
30
- src/haproxy-systemd-wrapper.c | 27 ++++++++++++++++++++++-----
31
- 1 file changed, 22 insertions(+), 5 deletions(-)
32
-
33
-diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c
34
-index cc8baa8..446f28f 100644
35
---- a/src/haproxy-systemd-wrapper.c
36
-+++ b/src/haproxy-systemd-wrapper.c
37
-@@ -28,20 +28,36 @@ static char *pid_file = "/run/haproxy.pid";
38
- static int wrapper_argc;
39
- static char **wrapper_argv;
40
- 
41
-+/* returns the path to the haproxy binary into <buffer>, whose size indicated
42
-+ * in <buffer_size> must be at least 1 byte long.
43
-+ */
44
- static void locate_haproxy(char *buffer, size_t buffer_size)
45
- {
46
- 	char *end = NULL;
47
-+	int len;
48
-+
49
-+	len = readlink("/proc/self/exe", buffer, buffer_size - 1);
50
-+	if (len == -1)
51
-+		goto fail;
52
- 
53
--	if (readlink("/proc/self/exe", buffer, buffer_size) > 0)
54
--		end = strrchr(buffer, '/');
55
-+	buffer[len] = 0;
56
-+	end = strrchr(buffer, '/');
57
-+	if (end == NULL)
58
-+		goto fail;
59
- 
60
--	if (end == NULL) {
61
--		strncpy(buffer, "/usr/sbin/haproxy", buffer_size);
62
-+	if (strcmp(end + strlen(end) - 16, "-systemd-wrapper") == 0) {
63
-+		end[strlen(end) - 16] = '\0';
64
- 		return;
65
- 	}
66
-+
67
- 	end[1] = '\0';
68
- 	strncpy(end + 1, "haproxy", buffer + buffer_size - (end + 1));
69
- 	buffer[buffer_size - 1] = '\0';
70
-+	return;
71
-+ fail:
72
-+	strncpy(buffer, "/usr/sbin/haproxy", buffer_size);
73
-+	buffer[buffer_size - 1] = '\0';
74
-+	return;
75
- }
76
- 
77
- static void spawn_haproxy(char **pid_strv, int nb_pid)
78
-@@ -54,7 +70,8 @@ static void spawn_haproxy(char **pid_strv, int nb_pid)
79
- 	main_argc = wrapper_argc - 1;
80
- 	main_argv = wrapper_argv + 1;
81
- 
82
--	pid = fork();
83
-+	//pid = fork();
84
-+	pid=0;
85
- 	if (!pid) {
86
- 		/* 3 for "haproxy -Ds -sf" */
87
- 		char **argv = calloc(4 + main_argc + nb_pid + 1, sizeof(char *));
88
-1.8.5.5
89
-

+ 0
- 35
net/haproxy/patches/0015-BUG-MEDIUM-remove-debugging-code-from-systemd-wrappe.patch View File

@@ -1,36 +0,0 @@
1
-From 575e299cc07f5f2b314d91dfac8671834cbdd2a7 Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Wed, 24 Sep 2014 12:59:25 +0200
4
-Subject: [PATCH 15/20] BUG/MEDIUM: remove debugging code from systemd-wrapper
5
-MIME-Version: 1.0
6
-Content-Type: text/plain; charset=UTF-8
7
-Content-Transfer-Encoding: 8bit
8
-
9
-Kristoffer Grönlund reported that after my recent update to the
10
-systemd-wrapper, I accidentely left the debugging code which
11
-consists in disabling the fork :-(
12
-
13
-The fix needs to be backported to 1.5 as well since I pushed it
14
-there as well.
15
-(cherry picked from commit a55bbc64d8272e4066a67b6d190ffebaff2b300a)
16
----
17
- src/haproxy-systemd-wrapper.c | 3 +--
18
- 1 file changed, 1 insertion(+), 2 deletions(-)
19
-
20
-diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c
21
-index 446f28f..8602881 100644
22
---- a/src/haproxy-systemd-wrapper.c
23
-+++ b/src/haproxy-systemd-wrapper.c
24
-@@ -70,8 +70,7 @@ static void spawn_haproxy(char **pid_strv, int nb_pid)
25
- 	main_argc = wrapper_argc - 1;
26
- 	main_argv = wrapper_argv + 1;
27
- 
28
--	//pid = fork();
29
--	pid=0;
30
-+	pid = fork();
31
- 	if (!pid) {
32
- 		/* 3 for "haproxy -Ds -sf" */
33
- 		char **argv = calloc(4 + main_argc + nb_pid + 1, sizeof(char *));
34
-2.0.4
35
-

+ 0
- 187
net/haproxy/patches/0016-BUG-MEDIUM-http-adjust-close-mode-when-switching-to-.patch View File

@@ -1,188 +0,0 @@
1
-From 2e47a3ab11188239abadb6bba7bd901d764aa4fb Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Tue, 30 Sep 2014 18:44:22 +0200
4
-Subject: [PATCH 16/20] BUG/MEDIUM: http: adjust close mode when switching to
5
- backend
6
-
7
-Commit 179085c ("MEDIUM: http: move Connection header processing earlier")
8
-introduced a regression : the backend's HTTP mode is not considered anymore
9
-when setting the session's HTTP mode, because wait_for_request() is only
10
-called once, when the frontend receives the request (or when the frontend
11
-is in TCP mode, when the backend receives the request).
12
-
13
-The net effect is that in some situations when the frontend and the backend
14
-do not work in the same mode (eg: keep-alive vs close), the backend's mode
15
-is ignored.
16
-
17
-This patch moves all that processing to a dedicated function, which is
18
-called from the original place, as well as from session_set_backend()
19
-when switching from an HTTP frontend to an HTTP backend in different
20
-modes.
21
-
22
-This fix must be backported to 1.5.
23
-(cherry picked from commit 4e21ff9244aefa56bcf0793a9e07edba2c3c1960)
24
----
25
- include/proto/proto_http.h |   1 +
26
- src/proto_http.c           | 107 +++++++++++++++++++++++----------------------
27
- src/proxy.c                |   8 ++++
28
- 3 files changed, 64 insertions(+), 52 deletions(-)
29
-
30
-diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h
31
-index e898ca8..8014310 100644
32
---- a/include/proto/proto_http.h
33
-+++ b/include/proto/proto_http.h
34
-@@ -112,6 +112,7 @@ unsigned int http_get_hdr(const struct http_msg *msg, const char *hname, int hle
35
- void http_init_txn(struct session *s);
36
- void http_end_txn(struct session *s);
37
- void http_reset_txn(struct session *s);
38
-+void http_adjust_conn_mode(struct session *s, struct http_txn *txn, struct http_msg *msg);
39
- 
40
- struct http_req_rule *parse_http_req_cond(const char **args, const char *file, int linenum, struct proxy *proxy);
41
- struct http_res_rule *parse_http_res_cond(const char **args, const char *file, int linenum, struct proxy *proxy);
42
-diff --git a/src/proto_http.c b/src/proto_http.c
43
-index 7e35c8b..20e7088 100644
44
---- a/src/proto_http.c
45
-+++ b/src/proto_http.c
46
-@@ -2393,6 +2393,59 @@ fail:
47
- 	return 0;
48
- }
49
- 
50
-+void http_adjust_conn_mode(struct session *s, struct http_txn *txn, struct http_msg *msg)
51
-+{
52
-+	int tmp = TX_CON_WANT_KAL;
53
-+
54
-+	if (!((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA)) {
55
-+		if ((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN ||
56
-+		    (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN)
57
-+			tmp = TX_CON_WANT_TUN;
58
-+
59
-+		if ((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL ||
60
-+		    (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL)
61
-+			tmp = TX_CON_WANT_TUN;
62
-+	}
63
-+
64
-+	if ((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_SCL ||
65
-+	    (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_SCL) {
66
-+		/* option httpclose + server_close => forceclose */
67
-+		if ((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL ||
68
-+		    (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL)
69
-+			tmp = TX_CON_WANT_CLO;
70
-+		else
71
-+			tmp = TX_CON_WANT_SCL;
72
-+	}
73
-+
74
-+	if ((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_FCL ||
75
-+	    (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_FCL)
76
-+		tmp = TX_CON_WANT_CLO;
77
-+
78
-+	if ((txn->flags & TX_CON_WANT_MSK) < tmp)
79
-+		txn->flags = (txn->flags & ~TX_CON_WANT_MSK) | tmp;
80
-+
81
-+	if (!(txn->flags & TX_HDR_CONN_PRS) &&
82
-+	    (txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_TUN) {
83
-+		/* parse the Connection header and possibly clean it */
84
-+		int to_del = 0;
85
-+		if ((msg->flags & HTTP_MSGF_VER_11) ||
86
-+		    ((txn->flags & TX_CON_WANT_MSK) >= TX_CON_WANT_SCL &&
87
-+		     !((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA)))
88
-+			to_del |= 2; /* remove "keep-alive" */
89
-+		if (!(msg->flags & HTTP_MSGF_VER_11))
90
-+			to_del |= 1; /* remove "close" */
91
-+		http_parse_connection_header(txn, msg, to_del);
92
-+	}
93
-+
94
-+	/* check if client or config asks for explicit close in KAL/SCL */
95
-+	if (((txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_KAL ||
96
-+	     (txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_SCL) &&
97
-+	    ((txn->flags & TX_HDR_CONN_CLO) ||                         /* "connection: close" */
98
-+	     (!(msg->flags & HTTP_MSGF_VER_11) && !(txn->flags & TX_HDR_CONN_KAL)) || /* no "connection: k-a" in 1.0 */
99
-+	     !(msg->flags & HTTP_MSGF_XFER_LEN) ||                     /* no length known => close */
100
-+	     s->fe->state == PR_STSTOPPED))                            /* frontend is stopping */
101
-+		txn->flags = (txn->flags & ~TX_CON_WANT_MSK) | TX_CON_WANT_CLO;
102
-+}
103
- 
104
- /* This stream analyser waits for a complete HTTP request. It returns 1 if the
105
-  * processing can continue on next analysers, or zero if it either needs more
106
-@@ -2929,58 +2982,8 @@ int http_wait_for_request(struct session *s, struct channel *req, int an_bit)
107
- 	 * time.
108
- 	 */
109
- 	if (!(txn->flags & TX_HDR_CONN_PRS) ||
110
--	    ((s->fe->options & PR_O_HTTP_MODE) != (s->be->options & PR_O_HTTP_MODE))) {
111
--		int tmp = TX_CON_WANT_KAL;
112
--
113
--		if (!((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA)) {
114
--			if ((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN ||
115
--			    (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN)
116
--				tmp = TX_CON_WANT_TUN;
117
--
118
--			if ((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL ||
119
--			    (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL)
120
--				tmp = TX_CON_WANT_TUN;
121
--		}
122
--
123
--		if ((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_SCL ||
124
--		    (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_SCL) {
125
--			/* option httpclose + server_close => forceclose */
126
--			if ((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL ||
127
--			    (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL)
128
--				tmp = TX_CON_WANT_CLO;
129
--			else
130
--				tmp = TX_CON_WANT_SCL;
131
--		}
132
--
133
--		if ((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_FCL ||
134
--		    (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_FCL)
135
--			tmp = TX_CON_WANT_CLO;
136
--
137
--		if ((txn->flags & TX_CON_WANT_MSK) < tmp)
138
--			txn->flags = (txn->flags & ~TX_CON_WANT_MSK) | tmp;
139
--
140
--		if (!(txn->flags & TX_HDR_CONN_PRS) &&
141
--		    (txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_TUN) {
142
--			/* parse the Connection header and possibly clean it */
143
--			int to_del = 0;
144
--			if ((msg->flags & HTTP_MSGF_VER_11) ||
145
--			    ((txn->flags & TX_CON_WANT_MSK) >= TX_CON_WANT_SCL &&
146
--			     !((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA)))
147
--				to_del |= 2; /* remove "keep-alive" */
148
--			if (!(msg->flags & HTTP_MSGF_VER_11))
149
--				to_del |= 1; /* remove "close" */
150
--			http_parse_connection_header(txn, msg, to_del);
151
--		}
152
--
153
--		/* check if client or config asks for explicit close in KAL/SCL */
154
--		if (((txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_KAL ||
155
--		     (txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_SCL) &&
156
--		    ((txn->flags & TX_HDR_CONN_CLO) ||                         /* "connection: close" */
157
--		     (!(msg->flags & HTTP_MSGF_VER_11) && !(txn->flags & TX_HDR_CONN_KAL)) || /* no "connection: k-a" in 1.0 */
158
--		     !(msg->flags & HTTP_MSGF_XFER_LEN) ||                     /* no length known => close */
159
--		     s->fe->state == PR_STSTOPPED))                            /* frontend is stopping */
160
--		    txn->flags = (txn->flags & ~TX_CON_WANT_MSK) | TX_CON_WANT_CLO;
161
--	}
162
-+	    ((s->fe->options & PR_O_HTTP_MODE) != (s->be->options & PR_O_HTTP_MODE)))
163
-+		http_adjust_conn_mode(s, txn, msg);
164
- 
165
- 	/* end of job, return OK */
166
- 	req->analysers &= ~an_bit;
167
-diff --git a/src/proxy.c b/src/proxy.c
168
-index 02103ee..405c4c4 100644
169
---- a/src/proxy.c
170
-+++ b/src/proxy.c
171
-@@ -955,6 +955,14 @@ int session_set_backend(struct session *s, struct proxy *be)
172
- 		http_init_txn(s);
173
- 	}
174
- 
175
-+	/* If we chain to an HTTP backend running a different HTTP mode, we
176
-+	 * have to re-adjust the desired keep-alive/close mode to accommodate
177
-+	 * both the frontend's and the backend's modes.
178
-+	 */
179
-+	if (s->fe->mode == PR_MODE_HTTP && be->mode == PR_MODE_HTTP &&
180
-+	    ((s->fe->options & PR_O_HTTP_MODE) != (be->options & PR_O_HTTP_MODE)))
181
-+		http_adjust_conn_mode(s, &s->txn, &s->txn.req);
182
-+
183
- 	/* If an LB algorithm needs to access some pre-parsed body contents,
184
- 	 * we must not start to forward anything until the connection is
185
- 	 * confirmed otherwise we'll lose the pointer to these data and
186
-2.0.4
187
-

+ 0
- 45
net/haproxy/patches/0017-BUG-MINOR-config-don-t-propagate-process-binding-on-.patch View File

@@ -1,46 +0,0 @@
1
-From b3228c83e320ad168f5b3e6884e771530a68a449 Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Wed, 1 Oct 2014 20:50:17 +0200
4
-Subject: [PATCH 17/20] BUG/MINOR: config: don't propagate process binding on
5
- fatal errors.
6
-
7
-propagate_processes() must not be called with unresolved proxies, but
8
-nothing prevents it from being called in check_config_validity(). The
9
-resulting effect is that an unresolved proxy can cause a recursion
10
-loop if called in such a situation, ending with a segfault after the
11
-fatal error report. There's no side effect beyond this.
12
-
13
-This patch refrains from calling the function when any error was met.
14
-
15
-This bug also affects 1.5, it should be backported.
16
-(cherry picked from commit acbe8ab38a638a076f8cf9fe2635db0e729d6a1f)
17
----
18
- src/cfgparse.c | 12 ++++++++----
19
- 1 file changed, 8 insertions(+), 4 deletions(-)
20
-
21
-diff --git a/src/cfgparse.c b/src/cfgparse.c
22
-index f723a3a..6e962c8 100644
23
---- a/src/cfgparse.c
24
-+++ b/src/cfgparse.c
25
-@@ -7112,10 +7112,14 @@ out_uri_auth_compat:
26
- 			global.stats_fe->bind_proc = ~0UL;
27
- 	}
28
- 
29
--	/* propagate bindings from frontends to backends */
30
--	for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
31
--		if (curproxy->cap & PR_CAP_FE)
32
--			propagate_processes(curproxy, NULL);
33
-+	/* propagate bindings from frontends to backends. Don't do it if there
34
-+	 * are any fatal errors as we must not call it with unresolved proxies.
35
-+	 */
36
-+	if (!cfgerr) {
37
-+		for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
38
-+			if (curproxy->cap & PR_CAP_FE)
39
-+				propagate_processes(curproxy, NULL);
40
-+		}
41
- 	}
42
- 
43
- 	/* Bind each unbound backend to all processes when not specified. */
44
-2.0.4
45
-

+ 0
- 101
net/haproxy/patches/0018-BUG-MEDIUM-check-rule-less-tcp-check-must-detect-con.patch View File

@@ -1,102 +0,0 @@
1
-From e61737a721c3b91c79484e51fc1789293b269f9f Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Thu, 2 Oct 2014 14:30:14 +0200
4
-Subject: [PATCH 18/20] BUG/MEDIUM: check: rule-less tcp-check must detect
5
- connect failures
6
-
7
-When "option tcp-check" is specified without any tcp-check rules, the
8
-documentation says that it's the same as the default check method. But
9
-the code path is a bit different, and we used to consider that since
10
-the end of rules was reached, the check is always successful regardless
11
-of the connection status.
12
-
13
-This patch reorganizes the error detection, and considers the special
14
-case where there's no tcp-check rule as a real L4 check. It also avoids
15
-dereferencing the rule list head as a rule by itself.
16
-
17
-While fixing this bug, another one related to the output messages'
18
-accuracy was noticed, it will be fixed in a separate commit and is
19
-much less important.
20
-
21
-This bug is also present in 1.5, so this fix must be backported.
22
-(cherry picked from commit ef953953e7f33c6a72c432fce8d47c2d84c69512)
23
----
24
- src/checks.c | 40 +++++++++++++++++++++++++---------------
25
- 1 file changed, 25 insertions(+), 15 deletions(-)
26
-
27
-diff --git a/src/checks.c b/src/checks.c
28
-index f3b2b54..9c1a866 100644
29
---- a/src/checks.c
30
-+++ b/src/checks.c
31
-@@ -1837,20 +1837,34 @@ static int tcpcheck_get_step_id(struct server *s)
32
- static void tcpcheck_main(struct connection *conn)
33
- {
34
- 	char *contentptr;
35
--	struct list *head = NULL;
36
- 	struct tcpcheck_rule *cur = NULL;
37
- 	int done = 0, ret = 0;
38
--
39
- 	struct check *check = conn->owner;
40
- 	struct server *s = check->server;
41
- 	struct task *t = check->task;
42
-+	struct list *head = &s->proxy->tcpcheck_rules;
43
- 
44
--	/*
45
--	 * don't do anything until the connection is established but if we're running
46
--	 * first step which must be a connect
47
-+	/* here, we know that the check is complete or that it failed */
48
-+	if (check->result != CHK_RES_UNKNOWN)
49
-+		goto out_end_tcpcheck;
50
-+
51
-+	/* We have 4 possibilities here :
52
-+	 *   1. we've not yet attempted step 1, and step 1 is a connect, so no
53
-+	 *      connection attempt was made yet ;
54
-+	 *   2. we've not yet attempted step 1, and step 1 is a not connect or
55
-+	 *      does not exist (no rule), so a connection attempt was made
56
-+	 *      before coming here.
57
-+	 *   3. we're coming back after having started with step 1, so we may
58
-+	 *      be waiting for a connection attempt to complete.
59
-+	 *   4. the connection + handshake are complete
60
-+	 *
61
-+	 * #2 and #3 are quite similar, we want both the connection and the
62
-+	 * handshake to complete before going any further. Thus we must always
63
-+	 * wait for a connection to complete unless we're before and existing
64
-+	 * step 1.
65
- 	 */
66
--	if (check->current_step && (!(conn->flags & CO_FL_CONNECTED))) {
67
--		/* update expire time, should be done by process_chk */
68
-+	if ((!(conn->flags & CO_FL_CONNECTED) || (conn->flags & CO_FL_HANDSHAKE)) &&
69
-+	    (check->current_step || LIST_ISEMPTY(head))) {
70
- 		/* we allow up to min(inter, timeout.connect) for a connection
71
- 		 * to establish but only when timeout.check is set
72
- 		 * as it may be to short for a full check otherwise
73
-@@ -1867,12 +1881,11 @@ static void tcpcheck_main(struct connection *conn)
74
- 		return;
75
- 	}
76
- 
77
--	/* here, we know that the connection is established */
78
--	if (check->result != CHK_RES_UNKNOWN)
79
-+	/* special case: option tcp-check with no rule, a connect is enough */
80
-+	if (LIST_ISEMPTY(head)) {
81
-+		set_server_check_status(check, HCHK_STATUS_L4OK, NULL);
82
- 		goto out_end_tcpcheck;
83
--
84
--	/* head is be the first element of the double chained list */
85
--	head = &s->proxy->tcpcheck_rules;
86
-+	}
87
- 
88
- 	/* no step means first step
89
- 	 * initialisation */
90
-@@ -1891,9 +1904,6 @@ static void tcpcheck_main(struct connection *conn)
91
- 		cur = check->current_step;
92
- 	}
93
- 
94
--	if (conn->flags & CO_FL_HANDSHAKE)
95
--		return;
96
--
97
- 	/* It's only the rules which will enable send/recv */
98
- 	__conn_data_stop_both(conn);
99
- 
100
-2.0.4
101
-

+ 0
- 110
net/haproxy/patches/0019-BUG-MINOR-tcp-check-report-the-correct-failed-step-i.patch View File

@@ -1,111 +0,0 @@
1
-From 90055f28a7a0c86cfb37ccb23a548a1da7229551 Mon Sep 17 00:00:00 2001
2
-From: Willy Tarreau <w@1wt.eu>
3
-Date: Thu, 2 Oct 2014 14:51:02 +0200
4
-Subject: [PATCH 19/20] BUG/MINOR: tcp-check: report the correct failed step in
5
- the status
6
-
7
-The step number was reported by checking only last_started_step, which
8
-was not set in case of error during the initial connection phase, and
9
-caused "step 1" to be returned with an invalid check type (typically
10
-SEND). So now we first verify that a test was started before returning
11
-this.
12
-
13
-In addition to this, the indication of the test type was taken from
14
-current_step instead of last_started_step, so the error description
15
-was matching the next action instead of the one reported in the step
16
-ID. Thus we could get the confusing "step 1 (send)" report below :
17
-
18
-      tcp-check connect
19
-      tcp-check send foo
20
-
21
-In order to ease debugging, when the port number is known for a connect,
22
-it is indicated in the error report.
23
-
24
-Note that this only affects asynchronous error messages, synchronous ones
25
-are correct.
26
-
27
-This fix must be backported to 1.5.
28
-(cherry picked from commit 213c6785614d0228d7e96e982e5189e1d0777059)
29
----
30
- src/checks.c | 43 ++++++++++++++++++++++++++++---------------
31
- 1 file changed, 28 insertions(+), 15 deletions(-)
32
-
33
-diff --git a/src/checks.c b/src/checks.c
34
-index 9c1a866..5318f35 100644
35
---- a/src/checks.c
36
-+++ b/src/checks.c
37
-@@ -580,6 +580,7 @@ static void chk_report_conn_err(struct connection *conn, int errno_bck, int expi
38
- 	struct check *check = conn->owner;
39
- 	const char *err_msg;
40
- 	struct chunk *chk;
41
-+	int step;
42
- 
43
- 	if (check->result != CHK_RES_UNKNOWN)
44
- 		return;
45
-@@ -599,19 +600,27 @@ static void chk_report_conn_err(struct connection *conn, int errno_bck, int expi
46
- 	chk = get_trash_chunk();
47
- 
48
- 	if (check->type == PR_O2_TCPCHK_CHK) {
49
--		chunk_printf(chk, " at step %d of tcp-check", tcpcheck_get_step_id(check->server));
50
--		/* we were looking for a string */
51
--		if (check->current_step && check->current_step->action == TCPCHK_ACT_CONNECT) {
52
--			chunk_appendf(chk, " (connect)");
53
--		}
54
--		else if (check->current_step && check->current_step->action == TCPCHK_ACT_EXPECT) {
55
--			if (check->current_step->string)
56
--				chunk_appendf(chk, " (string '%s')", check->current_step->string);
57
--			else if (check->current_step->expect_regex)
58
--				chunk_appendf(chk, " (expect regex)");
59
--		}
60
--		else if (check->current_step && check->current_step->action == TCPCHK_ACT_SEND) {
61
--			chunk_appendf(chk, " (send)");
62
-+		step = tcpcheck_get_step_id(check->server);
63
-+		if (!step)
64
-+			chunk_printf(chk, " at initial connection step of tcp-check");
65
-+		else {
66
-+			chunk_printf(chk, " at step %d of tcp-check", step);
67
-+			/* we were looking for a string */
68
-+			if (check->last_started_step && check->last_started_step->action == TCPCHK_ACT_CONNECT) {
69
-+				if (check->last_started_step->port)
70
-+					chunk_appendf(chk, " (connect port %d)" ,check->last_started_step->port);
71
-+				else
72
-+					chunk_appendf(chk, " (connect)");
73
-+			}
74
-+			else if (check->last_started_step && check->last_started_step->action == TCPCHK_ACT_EXPECT) {
75
-+				if (check->last_started_step->string)
76
-+					chunk_appendf(chk, " (string '%s')", check->last_started_step->string);
77
-+				else if (check->last_started_step->expect_regex)
78
-+					chunk_appendf(chk, " (expect regex)");
79
-+			}
80
-+			else if (check->last_started_step && check->last_started_step->action == TCPCHK_ACT_SEND) {
81
-+				chunk_appendf(chk, " (send)");
82
-+			}
83
- 		}
84
- 	}
85
- 
86
-@@ -1818,6 +1827,10 @@ static int tcpcheck_get_step_id(struct server *s)
87
- 	struct tcpcheck_rule *cur = NULL, *next = NULL;
88
- 	int i = 0;
89
- 
90
-+	/* not even started anything yet => step 0 = initial connect */
91
-+	if (!s->check.current_step)
92
-+		return 0;
93
-+
94
- 	cur = s->check.last_started_step;
95
- 
96
- 	/* no step => first step */
97
-@@ -1887,9 +1900,9 @@ static void tcpcheck_main(struct connection *conn)
98
- 		goto out_end_tcpcheck;
99
- 	}
100
- 
101
--	/* no step means first step
102
--	 * initialisation */
103
-+	/* no step means first step initialisation */
104
- 	if (check->current_step == NULL) {
105
-+		check->last_started_step = NULL;
106
- 		check->bo->p = check->bo->data;
107
- 		check->bo->o = 0;
108
- 		check->bi->p = check->bi->data;
109
-2.0.4
110
-

+ 0
- 33
net/haproxy/patches/0020-BUG-MINOR-config-don-t-propagate-process-binding-for.patch View File

@@ -1,34 +0,0 @@
1
-From c8d57dec6173430bd5602bb76efff302c51e7803 Mon Sep 17 00:00:00 2001
2
-From: =?UTF-8?q?Cyril=20Bont=C3=A9?= <cyril.bonte@free.fr>
3
-Date: Thu, 2 Oct 2014 19:56:25 +0200
4
-Subject: [PATCH 20/20] BUG/MINOR: config: don't propagate process binding for
5
- dynamic use_backend
6
-
7
-A segfault was reported with the introduction of the propagate_processes()
8
-function. It was caused when a use_backend rule was declared with a dynamic
9
-name, using a log-format string. The backend is not resolved during the
10
-configuration, which lead to the segfault.
11
-
12
-The patch prevents the process binding propagation for such dynamic rules, it
13
-should also be backported to 1.5.
14
-(cherry picked from commit 51639696e0a112ea3612e905a5722ad912b3869f)
15
----
16
- src/cfgparse.c | 2 ++
17
- 1 file changed, 2 insertions(+)
18
-
19
-diff --git a/src/cfgparse.c b/src/cfgparse.c
20
-index 6e962c8..ec6d923 100644
21
---- a/src/cfgparse.c
22
-+++ b/src/cfgparse.c
23
-@@ -6015,6 +6015,8 @@ void propagate_processes(struct proxy *from, struct proxy *to)
24
- 
25
- 	/* use_backend */
26
- 	list_for_each_entry(rule, &from->switching_rules, list) {
27
-+		if (rule->dynamic)
28
-+			continue;
29
- 		to = rule->be.backend;
30
- 		propagate_processes(from, to);
31
- 	}
32
-2.0.4
33
-