From 89cca707632474af6333d0c84f5e880f1e36b8ff Mon Sep 17 00:00:00 2001 From: heil Date: Tue, 2 Apr 2013 13:52:02 +0000 Subject: [PATCH] package: haproxy - add backported patches for 1.4.22 git-svn-id: svn://svn.openwrt.org/openwrt/packages@36152 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/haproxy/Makefile | 2 +- ...EDIUM-http-implement-redirect-307-and-308.patch | 71 ++++++++ ...status-301-should-not-be-marked-non-cache.patch | 28 +++ ...-the-new-HTTP-307-and-308-redirect-statue.patch | 47 +++++ ...MEDIUM-poll-do-not-use-FD_-macros-anymore.patch | 193 +++++++++++++++++++++ ...v_select-disable-the-select-poller-if-max.patch | 77 ++++++++ ...LD-enable-poll-by-default-in-the-makefile.patch | 60 +++++++ ...2-BUILD-add-explicit-support-for-Mac-OS-X.patch | 57 ++++++ 8 files changed, 534 insertions(+), 1 deletion(-) create mode 100644 net/haproxy/patches/0036-MEDIUM-http-implement-redirect-307-and-308.patch create mode 100644 net/haproxy/patches/0037-MINOR-http-status-301-should-not-be-marked-non-cache.patch create mode 100644 net/haproxy/patches/0038-DOC-mention-the-new-HTTP-307-and-308-redirect-statue.patch create mode 100644 net/haproxy/patches/0039-MEDIUM-poll-do-not-use-FD_-macros-anymore.patch create mode 100644 net/haproxy/patches/0040-BUG-MAJOR-ev_select-disable-the-select-poller-if-max.patch create mode 100644 net/haproxy/patches/0041-BUILD-enable-poll-by-default-in-the-makefile.patch create mode 100644 net/haproxy/patches/0042-BUILD-add-explicit-support-for-Mac-OS-X.patch diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index bd3bc9e50..ff4028981 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=haproxy PKG_VERSION:=1.4.22 -PKG_RELEASE:=35 +PKG_RELEASE:=42 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.4/src diff --git a/net/haproxy/patches/0036-MEDIUM-http-implement-redirect-307-and-308.patch b/net/haproxy/patches/0036-MEDIUM-http-implement-redirect-307-and-308.patch new file mode 100644 index 000000000..56554ba3c --- /dev/null +++ b/net/haproxy/patches/0036-MEDIUM-http-implement-redirect-307-and-308.patch @@ -0,0 +1,71 @@ +From 8a92e409e706e503ba76f8863c87409192e9f082 Mon Sep 17 00:00:00 2001 +From: Yves Lafon +Date: Mon, 11 Mar 2013 11:06:05 -0400 +Subject: [PATCH 36/42] MEDIUM: http: implement redirect 307 and 308 + +I needed to emit a 307 and noticed it was not available so I did it, +as well as 308. +(cherry picked from commit 3e8d1ae2d25d3fae659fc560506af2ae9b20da12) +--- + src/cfgparse.c | 6 +++--- + src/proto_http.c | 20 ++++++++++++++++++++ + 2 files changed, 23 insertions(+), 3 deletions(-) + +diff --git a/src/cfgparse.c b/src/cfgparse.c +index e55d30a..345b415 100644 +--- a/src/cfgparse.c ++++ b/src/cfgparse.c +@@ -2215,9 +2215,9 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) + } + cur_arg++; + code = atol(args[cur_arg]); +- if (code < 301 || code > 303) { +- Alert("parsing [%s:%d] : '%s': unsupported HTTP code '%d'.\n", +- file, linenum, args[0], code); ++ if (code < 301 || code > 308 || (code > 303 && code < 307)) { ++ Alert("parsing [%s:%d] : '%s': unsupported HTTP code '%s' (must be one of 301, 302, 303, 307 or 308).\n", ++ file, linenum, args[0], args[cur_arg]); + err_code |= ERR_ALERT | ERR_FATAL; + goto out; + } +diff --git a/src/proto_http.c b/src/proto_http.c +index 06b3743..8d9d8e8 100644 +--- a/src/proto_http.c ++++ b/src/proto_http.c +@@ -90,6 +90,20 @@ const char *HTTP_303 = + "Content-length: 0\r\n" + "Location: "; /* not terminated since it will be concatenated with the URL */ + ++ ++/* same as 302 except that the browser MUST retry with the same method */ ++const char *HTTP_307 = ++ "HTTP/1.1 307 Temporary Redirect\r\n" ++ "Cache-Control: no-cache\r\n" ++ "Content-length: 0\r\n" ++ "Location: "; /* not terminated since it will be concatenated with the URL */ ++ ++/* same as 301 except that the browser MUST retry with the same method */ ++const char *HTTP_308 = ++ "HTTP/1.1 308 Permanent Redirect\r\n" ++ "Content-length: 0\r\n" ++ "Location: "; /* not terminated since it will be concatenated with the URL */ ++ + /* Warning: this one is an sprintf() fmt string, with as its only argument */ + const char *HTTP_401_fmt = + "HTTP/1.0 401 Unauthorized\r\n" +@@ -3355,6 +3369,12 @@ int http_process_req_common(struct session *s, struct buffer *req, int an_bit, s + + /* build redirect message */ + switch(rule->code) { ++ case 308: ++ msg_fmt = HTTP_308; ++ break; ++ case 307: ++ msg_fmt = HTTP_307; ++ break; + case 303: + msg_fmt = HTTP_303; + break; +-- +1.8.1.5 + diff --git a/net/haproxy/patches/0037-MINOR-http-status-301-should-not-be-marked-non-cache.patch b/net/haproxy/patches/0037-MINOR-http-status-301-should-not-be-marked-non-cache.patch new file mode 100644 index 000000000..01b06c8e9 --- /dev/null +++ b/net/haproxy/patches/0037-MINOR-http-status-301-should-not-be-marked-non-cache.patch @@ -0,0 +1,28 @@ +From 6c9ba3562cf57dc033a52c0973962c642b3aaf18 Mon Sep 17 00:00:00 2001 +From: Yves Lafon +Date: Mon, 11 Mar 2013 11:06:05 -0400 +Subject: [PATCH 37/42] MINOR: http: status 301 should not be marked + non-cacheable + +Also, browsers behaviour is inconsistent regarding the Cache-Control +header field on a 301. +(cherry picked from commit e267421e93eb35272a104c9c8fa6878880f42be8) +--- + src/proto_http.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/proto_http.c b/src/proto_http.c +index 8d9d8e8..a52c038 100644 +--- a/src/proto_http.c ++++ b/src/proto_http.c +@@ -73,7 +73,6 @@ const struct chunk http_100_chunk = { + /* Warning: no "connection" header is provided with the 3xx messages below */ + const char *HTTP_301 = + "HTTP/1.1 301 Moved Permanently\r\n" +- "Cache-Control: no-cache\r\n" + "Content-length: 0\r\n" + "Location: "; /* not terminated since it will be concatenated with the URL */ + +-- +1.8.1.5 + diff --git a/net/haproxy/patches/0038-DOC-mention-the-new-HTTP-307-and-308-redirect-statue.patch b/net/haproxy/patches/0038-DOC-mention-the-new-HTTP-307-and-308-redirect-statue.patch new file mode 100644 index 000000000..77135ce29 --- /dev/null +++ b/net/haproxy/patches/0038-DOC-mention-the-new-HTTP-307-and-308-redirect-statue.patch @@ -0,0 +1,47 @@ +From 89c12b19f9e42976c9c205cd1a42bb2e148b3235 Mon Sep 17 00:00:00 2001 +From: Willy Tarreau +Date: Fri, 29 Mar 2013 19:28:11 +0100 +Subject: [PATCH 38/42] DOC: mention the new HTTP 307 and 308 redirect statues + (cherry picked from commit b67fdc4cd8bde202f2805d98683ddab929469a05) + +--- + doc/configuration.txt | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +diff --git a/doc/configuration.txt b/doc/configuration.txt +index 20b89c2..9a99267 100644 +--- a/doc/configuration.txt ++++ b/doc/configuration.txt +@@ -309,6 +309,8 @@ Haproxy may emit the following status codes by itself : + 301 when performing a redirection, depending on the configured code + 302 when performing a redirection, depending on the configured code + 303 when performing a redirection, depending on the configured code ++ 307 when performing a redirection, depending on the configured code ++ 308 when performing a redirection, depending on the configured code + 400 for an invalid or too large request + 401 when an authentication is required to perform the action (when + accessing the stats page) +@@ -4057,12 +4059,14 @@ redirect prefix [code ]