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

2016-05-17 Thread Willy Tarreau
On Tue, May 17, 2016 at 11:34:24PM +0200, maxime de Roucy wrote: > I can do it tomorow evening (France time). Fine, thank you Maxime. No rush, don't worry. The most important is that we know what to do and that everyone agrees. Willy

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 Willy Tarreau
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 issue, what do you think > > about all this ? > > I don't have strong feelings about this -- the initial point I

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

2016-05-17 Thread Nenad Merdanovic
Hello Willy, On 05/17/2016 09:41 PM, Willy Tarreau wrote: > Nenad, you were the one reporting the sorting issue, what do you think > about all this ? I don't have strong feelings about this -- the initial point I asked about was the versionsort vs alphasort and then just pointing out that we've

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-17 Thread Willy Tarreau
On Tue, May 17, 2016 at 09:28:21PM +0200, Cyril Bonté wrote: > Le 17/05/2016 20:01, Willy Tarreau a écrit : > > At least we now need to find a way to fix this because we can't accept > > to have such random breakage in a way that it all but auditable. When > > you host 1000 customers and 50 of

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

2016-05-17 Thread Cyril Bonté
Le 17/05/2016 20:01, Willy Tarreau a écrit : At least we now need to find a way to fix this because we can't accept to have such random breakage in a way that it all but auditable. When you host 1000 customers and 50 of them start to report random breakage after an upgrade, you can only

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

2016-05-17 Thread Willy Tarreau
Hi Cyril, On Tue, May 17, 2016 at 07:55:01PM +0200, Cyril Bonté wrote: > Hi all, > > Le 14/05/2016 00:13, Willy Tarreau a écrit : > > Hi Maxime, > > > > On Sat, May 14, 2016 at 12:09:07AM +0200, Maxime de Roucy wrote: > > > Hello Willy, > > > > > > Le vendredi 13 mai 2016 à 19:22 +0200, Willy

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

2016-05-17 Thread Cyril Bonté
Hi all, Le 14/05/2016 00:13, Willy Tarreau a écrit : Hi Maxime, On Sat, May 14, 2016 at 12:09:07AM +0200, Maxime de Roucy wrote: Hello Willy, Le vendredi 13 mai 2016 à 19:22 +0200, Willy Tarreau a écrit : Maxime, could you please add a call to setlocale(LC_ALL, "") as suggested by Nenad

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

2016-05-13 Thread Willy Tarreau
Hi Maxime, On Sat, May 14, 2016 at 12:09:07AM +0200, Maxime de Roucy wrote: > Hello Willy, > > Le vendredi 13 mai 2016 à 19:22 +0200, Willy Tarreau a écrit : > > Maxime, could you please add a call to setlocale(LC_ALL, "") as > > suggested by Nenad before starting to scan the directories ? If >

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

2016-05-13 Thread Maxime de Roucy
Hello Willy, Le vendredi 13 mai 2016 à 19:22 +0200, Willy Tarreau a écrit : > Maxime, could you please add a call to setlocale(LC_ALL, "") as > suggested by Nenad before starting to scan the directories ? If > something isn't 100% clear to you, do not hesitate to ask for more > details, you won't

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

2016-05-13 Thread Willy Tarreau
On Fri, May 13, 2016 at 07:15:11PM +0200, Nenad Merdanovic wrote: > Hello Willy, > > On 5/13/2016 7:04 PM, Willy Tarreau wrote: > > I don't know, I'm not fond of setting things in the back of the user like > > this. I don't even know if we have other parts that are currently sensitive > > to the

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

2016-05-13 Thread Nenad Merdanovic
Hello Willy, On 5/13/2016 7:04 PM, Willy Tarreau wrote: > I don't know, I'm not fond of setting things in the back of the user like > this. I don't even know if we have other parts that are currently sensitive > to the locale and which could be affected. Wouldn't it be better to simply > add this

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

2016-05-13 Thread Willy Tarreau
On Fri, May 13, 2016 at 06:38:06PM +0200, Nenad Merdanovic wrote: > Hello Willy, > > On 5/13/2016 12:54 PM, Willy Tarreau wrote: > > Wait a minute, what do you mean by "different lower/upper case sorting" ? > > Do you mean that alphasort() ignores the case ? I'm seeing no mention about > > it in

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

2016-05-13 Thread Nenad Merdanovic
Hello Willy, On 5/13/2016 12:54 PM, Willy Tarreau wrote: > Wait a minute, what do you mean by "different lower/upper case sorting" ? > Do you mean that alphasort() ignores the case ? I'm seeing no mention about > it in the man page, so I'm confused. If this is the case, it can be annoying > for

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

2016-05-13 Thread Willy Tarreau
On Fri, May 13, 2016 at 11:18:23AM +0200, Nenad Merdanovic wrote: > >> If the .cnf files contain rules that are sensitive to ordering, this > >> could be problematic. I am not saying we should change it, just to > >> consider it :) > > > > I've thought about this as well but figured that we'd

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

2016-05-13 Thread Cyril Bonté
Hi all, Le 13/05/2016 08:07, Willy Tarreau a écrit : Hi Maxime, On Fri, May 13, 2016 at 12:48:43AM +0200, Maxime de Roucy wrote: 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

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

2016-05-13 Thread Nenad Merdanovic
Hello Willy, On 5/13/2016 11:04 AM, Willy Tarreau wrote: > Hi Nenad, > > On Fri, May 13, 2016 at 11:02:01AM +0200, Nenad Merdanovic wrote: >> Hello, >> >> On 5/13/2016 8:07 AM, Willy Tarreau wrote: >>> I think I'm fine with this one (I'll still wait a bit to let others >>> respond). >>> I just

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

2016-05-13 Thread Willy Tarreau
Hi Nenad, On Fri, May 13, 2016 at 11:02:01AM +0200, Nenad Merdanovic wrote: > Hello, > > On 5/13/2016 8:07 AM, Willy Tarreau wrote: > > I think I'm fine with this one (I'll still wait a bit to let others > > respond). > > I just have one small request, please move the addition of > >

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

2016-05-13 Thread Nenad Merdanovic
Hello, On 5/13/2016 8:07 AM, Willy Tarreau wrote: > I think I'm fine with this one (I'll still wait a bit to let others respond). > I just have one small request, please move the addition of list_append_word() > to its own patch : if later we use it to fix a bug which needs to be > backported,

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

2016-05-13 Thread Willy Tarreau
Hi Maxime, On Fri, May 13, 2016 at 12:48:43AM +0200, Maxime de Roucy wrote: > 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

[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
Hi Willy, > > I don't receive all the mails from haproxy@formilux.org. > > For exemple I didn't received : > > http://article.gmane.org/gmane.comp.web.haproxy/27795 > > Well, this one was sent to you directly by Cyril, so you should have > received it. Indeed, it was this one:  

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

2016-05-10 Thread Willy Tarreau
Hi Maxime, On Wed, May 11, 2016 at 12:37:36AM +0200, Maxime de Roucy wrote: > Hello Willy, > > I don't receive all the mails from haproxy@formilux.org. > For exemple I didn't received : > http://article.gmane.org/gmane.comp.web.haproxy/27795 Well, this one was sent to you directly by Cyril, so

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

2016-05-10 Thread Maxime de Roucy
Hello Willy, I don't receive all the mails from haproxy@formilux.org. For exemple I didn't received : http://article.gmane.org/gmane.comp.web.haproxy/27795 However I am sure I sent a blank mail to haproxy+subscr...@formilux.org  (I rechecked). Can you check on the server side ? > > I forgot to

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

2016-05-09 Thread Willy Tarreau
Hi Maxime, On Tue, May 10, 2016 at 12:07:15AM +0200, Maxime de Roucy wrote: > > > I'm not sure to like this feature in its current implementation. > > > I fear it will also create some new issues depending on how people > > > will use it. > > Indeed it should be use with care. > But for me it's

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

2016-05-09 Thread Willy Tarreau
On Tue, May 10, 2016 at 12:54:40AM +0200, maxime de Roucy wrote: > I forgot to free the memory allocated at 'filename = calloc' (why valgrind > didn't warn...). Forget this patch. I will send another one tomorow. Yes I noticed, and there's this one as well : > > +

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" a écrit : > If -f argument is a directory add all the files (and only files)

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

2016-05-09 Thread Pavlos Parissis
On 10/05/2016 12:07 πμ, Maxime de Roucy wrote: > Hi Willy and Cyril, > > I just send a new version of the patch. > I made some changes following the remarks of Willy. > >>> I'm not sure to like this feature in its current implementation. >>> I fear it will also create some new issues depending

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

2016-05-09 Thread Maxime de Roucy
Hi Willy, > > Instead I create Alert_exit which embedded the exit call inside > > Alert. > > I just sent the patchs. > > > > Is this solution good for you ? > > To be honnest, no, I really don't like it. There are very few such > locations that benefit from it and 2/3 of them even had the code

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

2016-05-09 Thread Maxime de Roucy
Hi Willy and Cyril, I just send a new version of the patch. I made some changes following the remarks of Willy. > > I'm not sure to like this feature in its current implementation. > > I fear it will also create some new issues depending on how people > > will use it. Indeed it should be use

[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 Cyril Bonté
Hi Maxime and Willy, Le 09/05/2016 11:17, Maxime de Roucy a écrit : 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 :) I'm not sure to like this feature in its current implementation. I fear

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

2016-05-09 Thread Willy Tarreau
On Mon, May 09, 2016 at 01:30:51PM +0200, Willy Tarreau wrote: > Hello Maxime, > > On Mon, May 09, 2016 at 11:17:25AM +0200, Maxime de Roucy wrote: > > > I have another comment here, please try to factor the error messages > > > using a goto, this block appears at least 3 times : > > > > I tried

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

2016-05-09 Thread Willy Tarreau
Hello Maxime, On Mon, May 09, 2016 at 11:17:25AM +0200, Maxime de Roucy wrote: > > I have another comment here, please try to factor the error messages > > using a goto, this block appears at least 3 times : > > I tried to use goto but there is always a slight difference in the > Alert(...)

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

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

2016-05-09 Thread Willy Tarreau
Hi, On Sun, May 08, 2016 at 11:41:17AM +0200, Maxime de Roucy wrote: > If -f argument is a directory add all the files (and only files) it > containes to the config files list. I think this is a nice addition, it completes well the ability to load an arbitrary file list. However I cannot merge

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
Hello, I just realize I include a typo when editing my commit message to respect the 75 char limit : > $ ./haproxy -C rootdir -f root2 -f superdir2 \ >    -f root -f superdir1 -f root1 is in fact : > $ ./haproxy -C rootdir -f root2 -f superdir2 \ >   

[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 ├──