From: Thomas Heil Date: Thu, 10 Jan 2013 23:47:03 +0000 (+0000) Subject: package: haproxy - add missing patches - add patch number to version X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=200a9e66d3240cbb7dfe93ec8a7aae12af5844a2;p=openwrt%2Fsvn-archive%2Fpackages.git package: haproxy - add missing patches - add patch number to version SVN-Revision: 35091 --- diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index e0928174a..3c5a8a84d 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:=1 +PKG_RELEASE:=23 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.4/src @@ -44,6 +44,7 @@ define Build/Compile LD="$(TARGET_CC)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=8192 -DSYSTEM_MAXCONN=65530" USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 \ + VERSION="$(PKG_VERSION)-patch$(PKG_RELEASE)" \ all install endef diff --git a/net/haproxy/patches/0001-BUG-MINOR-config-use-a-copy-of-the-file-name-i-1.4.22.diff b/net/haproxy/patches/0001-BUG-MINOR-config-use-a-copy-of-the-file-name-i-1.4.22.diff new file mode 100644 index 000000000..d77d4cef1 --- /dev/null +++ b/net/haproxy/patches/0001-BUG-MINOR-config-use-a-copy-of-the-file-name-i-1.4.22.diff @@ -0,0 +1,75 @@ +From 60f05a8eae1afda44d62066445a0c072659a1aa1 Mon Sep 17 00:00:00 2001 +From: Willy Tarreau +Date: Thu, 4 Oct 2012 08:01:43 +0200 +Subject: BUG/MINOR: config: use a copy of the file name in proxy configurations + +Each proxy contains a reference to the original config file and line +number where it was declared. The pointer used is just a reference to +the one passed to the function instead of being duplicated. The effect +is that it is not valid anymore at the end of the parsing and that all +proxies will be enumerated as coming from the same file on some late +configuration errors. This may happen for exmaple when reporting SSL +certificate issues. + +By copying using strdup(), we avoid this issue. + +1.4 has the same issue, though no report of the proxy file name is done +out of the config section. Anyway a backport is recommended to ease +post-mortem analysis. +(cherry picked from commit 8113a5d78f2d2abe942f88a3a4df9f8bb5e535ba) +--- + include/types/proxy.h | 2 +- + src/cfgparse.c | 4 ++-- + src/haproxy.c | 1 + + 3 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/include/types/proxy.h b/include/types/proxy.h +index 1773658..a06078a 100644 +--- a/include/types/proxy.h ++++ b/include/types/proxy.h +@@ -320,7 +320,7 @@ struct proxy { + int no_options2; /* PR_O2_* */ + + struct { +- const char *file; /* file where the section appears */ ++ char *file; /* file where the section appears */ + int line; /* line where the section appears */ + struct eb32_node id; /* place in the tree of used IDs */ + struct eb_root used_listener_id;/* list of listener IDs in use */ +diff --git a/src/cfgparse.c b/src/cfgparse.c +index 643f065..90fdbff 100644 +--- a/src/cfgparse.c ++++ b/src/cfgparse.c +@@ -1136,7 +1136,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) + init_new_proxy(curproxy); + curproxy->next = proxy; + proxy = curproxy; +- curproxy->conf.file = file; ++ curproxy->conf.file = strdup(file); + curproxy->conf.line = linenum; + curproxy->last_change = now.tv_sec; + curproxy->id = strdup(args[1]); +@@ -3425,7 +3425,7 @@ stats_error_parsing: + newsrv->next = curproxy->srv; + curproxy->srv = newsrv; + newsrv->proxy = curproxy; +- newsrv->conf.file = file; ++ newsrv->conf.file = strdup(file); + newsrv->conf.line = linenum; + + LIST_INIT(&newsrv->pendconns); +diff --git a/src/haproxy.c b/src/haproxy.c +index 6141a5b..2944462 100644 +--- a/src/haproxy.c ++++ b/src/haproxy.c +@@ -732,6 +732,7 @@ void deinit(void) + int i; + + while (p) { ++ free(p->conf.file); + free(p->id); + free(p->check_req); + free(p->cookie_name); +-- +1.7.1 + diff --git a/net/haproxy/patches/0002-BUG-MINOR-epoll-correctly-disable-FD-polling-i-1.4.22.diff b/net/haproxy/patches/0002-BUG-MINOR-epoll-correctly-disable-FD-polling-i-1.4.22.diff new file mode 100644 index 000000000..e02cf4731 --- /dev/null +++ b/net/haproxy/patches/0002-BUG-MINOR-epoll-correctly-disable-FD-polling-i-1.4.22.diff @@ -0,0 +1,53 @@ +From 72ce4c8f4e0531c50b3a0914d77858440d16d914 Mon Sep 17 00:00:00 2001 +From: Willy Tarreau +Date: Thu, 4 Oct 2012 21:54:41 +0200 +Subject: BUG/MINOR: epoll: correctly disable FD polling in fd_rem() + +When calling fd_rem(), the polling was not correctly disabled because the +->prev state was set to zero instead of the previous value. fd_rem() is +very rarely used, only just before closing a socket. + +The effect is that upon an error reported at the connection level, if the +task assigned to the connection was too slow to be woken up because of too +many other tasks in the run queue, the FD was still not disabled and caused +the connection handler to be called again with the same event until the task +was finally executed to close the fd. + +This issue only affects the epoll poller, not the sepoll variant nor any of +the other ones. + +It was already present in 1.4 and even 1.3 with the same almost unnoticeable +effects. The bug can in fact only be discovered during development where it +emphasizes other bugs. + +It should be backported anyway. +(cherry picked from commit f8cfa447c676849e1d1b007353d4ea2f7231e4a0) +--- + src/ev_epoll.c | 8 ++++++-- + 1 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/ev_epoll.c b/src/ev_epoll.c +index b976868..0b22da6 100644 +--- a/src/ev_epoll.c ++++ b/src/ev_epoll.c +@@ -194,11 +194,15 @@ REGPRM2 static int __fd_clr(const int fd, int dir) + REGPRM1 static void __fd_rem(int fd) + { + uint32_t ofs = FD2OFS(fd); ++ uint32_t old_evt; + +- if (unlikely(!((fd_evts[ofs] >> FD2BIT(fd)) & 3))) ++ old_evt = fd_evts[ofs] >> FD2BIT(fd); ++ old_evt &= 3; ++ ++ if (unlikely(!old_evt)) + return; + +- alloc_chg_list(fd, 0); ++ alloc_chg_list(fd, old_evt); + fd_evts[ofs] &= ~FD2MSK(fd); + return; + } +-- +1.7.1 + diff --git a/net/haproxy/patches/0003-CONTRIB-halog-sort-URLs-by-avg-bytes_read-or-t-1.4.22.diff b/net/haproxy/patches/0003-CONTRIB-halog-sort-URLs-by-avg-bytes_read-or-t-1.4.22.diff new file mode 100644 index 000000000..fa63d87ec --- /dev/null +++ b/net/haproxy/patches/0003-CONTRIB-halog-sort-URLs-by-avg-bytes_read-or-t-1.4.22.diff @@ -0,0 +1,191 @@ +From 69eeb17615cd032ec7b3a9496ddb811095e92cb4 Mon Sep 17 00:00:00 2001 +From: Baptiste +Date: Sat, 8 Sep 2012 23:10:03 +0200 +Subject: CONTRIB: halog: sort URLs by avg bytes_read or total bytes_read + +The patch attached to this mail brings ability to sort URLs by +averaged bytes read and total bytes read in HALog tool. +In most cases, bytes read is also the object size. +The purpose of this patch is to know which URL consume the most +bandwith, in average or in total. +It may be interesting as well to know the standard deviation (ecart +type in french) for some counters (like bytes_read). + +The results: +- Sorting by average bytes read per URL: +./halog -uba <~/tmp/haproxy.log | column -t | head +2246 lines in, 302 lines out, 194 parsing errors +18 0 5101 283 5101 283 126573 2278327 /lib/exe/js.php +1 0 1 1 1 1 106734 106734 /wp-admin/images/screenshots/theme-customizer.png +2 0 2 1 2 1 106511 213022 /wp-admin/css/wp-admin.css +1 0 1 1 1 1 96698 96698 /wp-admin/images/screenshots/captions-1.png +1 0 1 1 1 1 73165 73165 /wp-admin/images/screenshots/flex-header-1.png +4 0 0 0 0 0 64832 259328 /cuisine/wp-content/plugins/stats/open-flash-chart.swf +1 0 0 0 0 0 48647 48647 /wp-admin/images/screenshots/flex-header-3.png +1 0 0 0 0 0 44046 44046 /wp-admin/images/screenshots/captions-2.png +1 0 1 1 1 1 38830 38830 /wp-admin/images/screenshots/flex-header-2.png + +- Sorting by total bytes read per URL: +./halog -ubt <~/tmp/haproxy.log | column -t | head +2246 lines in, 302 lines out, 194 parsing errors +18 0 5101 283 5101 283 126573 2278327 /lib/exe/js.php +60 0 14387 239 14387 239 10081 604865 /lib/exe/css.php +64 2 8820 137 8819 142 7742 495524 /doku.php +14 0 250 17 250 17 24045 336632 /wp-admin/load-scripts.php +71 0 6422 90 6422 90 4048 287419 /wp-admin/ +4 0 0 0 0 0 64832 259328 /cuisine/wp-content/plugins/stats/open-flash-chart.swf +2 0 2 1 2 1 106511 213022 /wp-admin/css/wp-admin.css +31 3 5423 174 5040 180 6804 210931 /index +10 0 429 42 429 42 18009 180093 /cuisine/files/2011/10/tarte_figue_amande-e1318281546905-225x300.jpg +(cherry picked from commit 61aaad06e85ae7f46cf5589bce8bc7f9331e7962) +--- + contrib/halog/halog.c | 39 ++++++++++++++++++++++++++++++++------- + 1 files changed, 32 insertions(+), 7 deletions(-) + +diff --git a/contrib/halog/halog.c b/contrib/halog/halog.c +index f19be0b..274b7f3 100644 +--- a/contrib/halog/halog.c ++++ b/contrib/halog/halog.c +@@ -29,6 +29,7 @@ + #define SERVER_FIELD 8 + #define TIME_FIELD 9 + #define STATUS_FIELD 10 ++#define BYTES_SENT_FIELD 11 + #define TERM_CODES_FIELD 14 + #define CONN_FIELD 15 + #define QUEUE_LEN_FIELD 16 +@@ -67,6 +68,7 @@ struct url_stat { + char *url; + unsigned long long total_time; /* sum(all reqs' times) */ + unsigned long long total_time_ok; /* sum(all OK reqs' times) */ ++ unsigned long long total_bytes_sent; /* sum(all bytes sent) */ + unsigned int nb_err, nb_req; + }; + +@@ -94,8 +96,6 @@ struct url_stat { + #define FILT_COUNT_URL_TAVG 0x040000 + #define FILT_COUNT_URL_TTOTO 0x080000 + #define FILT_COUNT_URL_TAVGO 0x100000 +-#define FILT_COUNT_URL_ANY (FILT_COUNT_URL_ONLY|FILT_COUNT_URL_COUNT|FILT_COUNT_URL_ERR| \ +- FILT_COUNT_URL_TTOT|FILT_COUNT_URL_TAVG|FILT_COUNT_URL_TTOTO|FILT_COUNT_URL_TAVGO) + + #define FILT_HTTP_ONLY 0x200000 + #define FILT_TERM_CODE_NAME 0x400000 +@@ -106,6 +106,13 @@ struct url_stat { + #define FILT_QUEUE_ONLY 0x4000000 + #define FILT_QUEUE_SRV_ONLY 0x8000000 + ++#define FILT_COUNT_URL_BAVG 0x10000000 ++#define FILT_COUNT_URL_BTOT 0x20000000 ++ ++#define FILT_COUNT_URL_ANY (FILT_COUNT_URL_ONLY|FILT_COUNT_URL_COUNT|FILT_COUNT_URL_ERR| \ ++ FILT_COUNT_URL_TTOT|FILT_COUNT_URL_TAVG|FILT_COUNT_URL_TTOTO|FILT_COUNT_URL_TAVGO| \ ++ FILT_COUNT_URL_BAVG|FILT_COUNT_URL_BTOT) ++ + unsigned int filter = 0; + unsigned int filter_invert = 0; + const char *line; +@@ -128,9 +135,10 @@ void usage(FILE *output, const char *msg) + fprintf(output, + "%s" + "Usage: halog [-h|--help] for long help\n" +- " halog [-q] [-c] [-v] {-gt|-pct|-st|-tc|-srv|-u|-uc|-ue|-ua|-ut|-uao|-uto}\n" ++ " halog [-q] [-c]\n" ++ " {-gt|-pct|-st|-tc|-srv|-u|-uc|-ue|-ua|-ut|-uao|-uto|-uba|-ubt}\n" + " [-s ] [-e|-E] [-H] [-rt|-RT