Re: Graceful restart of Haproxy with SystemD

2016-06-08 Thread Maxime de Roucy
=commit;h=379d9c7c14e684ab1dcdb6467a6bf189153c2b1d Regards Maxime de Roucy signature.asc Description: This is a digitally signed message part

[PATCH] BUG/MEDIUM: init: don't use environment locale

2016-05-18 Thread Maxime de Roucy
This patch remove setlocale from the main function. Some regex may have different behaviours depending on the locale. Some LUA scripts may change their behaviour too (http://lua-users.org/wiki/LuaLocales). Without this patch (haproxy is using setlocale) : $ cat locale.cfg

[PATCH] BUG/MEDIUM: init: don't use environment locale

2016-05-18 Thread Maxime de Roucy
This patch remove setlocale from the main function. Some regex may have different behaviours depending on the locale. Some LUA scripts may change their behaviour too (http://lua-users.org/wiki/LuaLocales). Without this patch (haproxy is using setlocale) : $ cat locale.cfg

Re: [PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-17 Thread maxime de Roucy
I can do it tomorow evening (France time). Le 17 mai 2016 11:18 PM, "Willy Tarreau" a écrit : > On Tue, May 17, 2016 at 11:12:35PM +0200, Nenad Merdanovic wrote: > > Hello Willy, > > > > On 05/17/2016 09:41 PM, Willy Tarreau wrote: > > > Nenad, you were the one reporting the sorting

Re: [PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-17 Thread Maxime de Roucy
Le mardi 17 mai 2016 à 21:28 +0200, Cyril Bonté a écrit : > Well, I'd rather think we shouldn't bother with setlocale(), stay > with the C locale, and document how the files are sorted. The > behaviour is different than calling "haproxy -- *.cfg", where globing > is made by the shell itself and

Re: [PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-13 Thread Maxime de Roucy
y -C rootdir -f aaa  aaa/a.cfg aaa/A.cfg aaa/à.cfg aaa/À.cfg aaa/â.cfg aaa/Â.cfg $ LC_COLLATE=C ./haproxy -C rootdir -f aaa  aaa/A.cfg aaa/a.cfg aaa/À.cfg aaa/Â.cfg aaa/à.cfg aaa/â.cfg --  Regard

[PATCH 1/3] MINOR: add list_append_word function

2016-05-13 Thread Maxime de Roucy
int list_append_word(struct list *li, const char *str, char **err) Append a copy of string (inside a wordlist) at the end of the list . The caller is responsible for freeing the and copy memory area using free(). On failure : return 0 and filled with an error message. ---

[PATCH 2/3] MEDIUM: init: use list_append_word in haproxy.c

2016-05-13 Thread Maxime de Roucy
replace LIST_ADDQ with list_append_word --- src/haproxy.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index bfd542c..3166bba 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -561,6 +561,7 @@ void init(int argc, char

[PATCH 3/3] MEDIUM: init: allow directory as argument of -f

2016-05-13 Thread Maxime de Roucy
If -f argument is a directory add all the files (and only files) it containes to the config files list. These files are added in lexical order (respecting LC_COLLATE). Only files with ".cfg" extension are added. Only non hidden files (not prefixed with ".") are added. Symlink are followed. The -f

[PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-12 Thread Maxime de Roucy
If -f argument is a directory add all the files (and only files) it containes to the config files list. These files are added in lexical order (man alphasort). Only files with ".cfg" extension are added. Only non hidden files (not prefixed with ".") are added. Symlink are followed. The -f order is

Re: [PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-11 Thread Maxime de Roucy
rg = 0; > > + > > + while (argc_i > 0) { > > + if (*argv_i == wl->s) > > + is_arg = 1; > > + argv_i++; > > + argc_i--; > > + } > > + > > +

Re: [PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-10 Thread Maxime de Roucy
it shouldn't be able to fail (the string size == copied size == calloc size). Here is a new version of the patch. Only for the src/haproxy.c file. I will send a complete patch when everything will be settled. I also free head memory from the "wlt = calloc(1, sizeof(*wlt));" line, in t

Re: [PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-09 Thread maxime de Roucy
I forgot to free the memory allocated at 'filename = calloc' (why valgrind didn't warn...). Forget this patch. I will send another one tomorow. Sorry Le 9 mai 2016 11:28 PM, "Maxime de Roucy" <maxime.dero...@gmail.com> a écrit : > If -f argument is a directory add all the fi

Re: [PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-09 Thread Maxime de Roucy
e confusing or missing. Indeed… let's forget about it. --  Maxime de Roucy signature.asc Description: This is a digitally signed message part

Re: [PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-09 Thread Maxime de Roucy
n should go on before we go further with the > code. OK. For me we should add a filter on file name ; keeping only ending with ".cfg" and not starting with ".". I vote for following symlinks, as the implementation currently does. It means less work for me :-) … Joking asi

[PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-09 Thread Maxime de Roucy
If -f argument is a directory add all the files (and only files) it containes to the config files list. These files are added in lexical order (man alphasort). The -f order is still respected: $ tree rootdir rootdir ├── root1 ├── root2 ├── root3 ├──

Re: [PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-09 Thread Maxime de Roucy
Hello, Thanks for your remarks ! > I think this is a nice addition, it completes well the ability to > load an arbitrary file list. Good to hear that :) > However I cannot merge it as is, there is a huge buffer overflow > … Ok, I see. I will try to patch that this evening. > I have another

[PATCH 2/2] MINOR: log: use Alert_exit in src/haproxy.c

2016-05-09 Thread Maxime de Roucy
This patch replace Alert(...); exit(1); with Alert(1, ...) when it's possible. --- src/haproxy.c | 176 +- 1 file changed, 87 insertions(+), 89 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 0c223e5..c1acea6 100644 ---

[PATCH 1/2] MINOR: log: Alert_exit function creation

2016-05-09 Thread Maxime de Roucy
Alert is often followed by exit. Alert_exit embedded the exit call. --- include/proto/log.h | 9 + src/log.c | 31 ++- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/include/proto/log.h b/include/proto/log.h index e606a3c..7afa2a0

Re: [PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-08 Thread Maxime de Roucy
Hello, The second version of the patch fix the typo already mentioned and change : - wlt->s = calloc(MAX_CLI_DIRFILE_NAME, 1); + wlt->s = calloc(strlen(filename) + 1, sizeof(*wlt->s)); --  Regards Maxime de Roucy signature.asc Description: This is a digitally signed message part

[PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-08 Thread Maxime de Roucy
If -f argument is a directory add all the files (and only files) it containes to the config files list. These files are added in lexical order (man alphasort). The -f order is still respected: $ tree rootdir rootdir ├── root1 ├── root2 ├── root3 ├──

Re: [PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-07 Thread Maxime de Roucy
superdir2 \ >    -f root3 -f superdir1 -f root1 Should I re-send my patch or is it OK ? --  Regards Maxime de Roucy signature.asc Description: This is a digitally signed message part

[PATCH] MEDIUM: init: allow directory as argument of -f

2016-05-07 Thread Maxime de Roucy
If -f argument is a directory add all the files (and only files) it containes to the config files list. These files are added in lexical order (man alphasort). The -f order is still respected: $ tree rootdir rootdir ├── root1 ├── root2 ├── root3 ├──