Re: Minor - patch 1.6.x - Fix some warnings in Connection.c
Omg haha I'm an oaf. Thanks! I'm surprised that also didn't cause another warning. On May 26, 2016 12:19 AM, "Willy Tarreau" <w...@1wt.eu> wrote: > Hi Jonathan, > > On Tue, May 24, 2016 at 05:04:16AM -0500, Jonathan Fisher wrote: > > What's the style you prefer? > > This one without the double negation :-) > > - if (!memcmp(line, "TCP4 ", 5) != 0) { > + if (memcmp(line, "TCP4 ", 5) == 0) { > > I've just backported it now. > > Cheers, > Willy > >
Re: Minor - patch 1.6.x - Fix some warnings in Connection.c
What's the style you prefer? On May 24, 2016 1:10 AM, "Willy Tarreau" <w...@1wt.eu> wrote: > Hi Jonathan, > > On Fri, May 20, 2016 at 01:14:31PM -0400, Jonathan Fisher wrote: > > These warnings bother me. > > > > > > > > -- > > *Jonathan S. Fisher* > > Senior Software Engineer > > https://twitter.com/exabrial > > http://www.tomitribe.com > > https://www.tomitribe.io > > > diff --git a/src/connection.c b/src/connection.c > > index 991cae3..12cdef0 100644 > > --- a/src/connection.c > > +++ b/src/connection.c > > @@ -385,7 +385,7 @@ int conn_recv_proxy(struct connection *conn, int > flag) > > if (trash.len < 9) /* shortest possible line */ > > goto missing; > > > > - if (!memcmp(line, "TCP4 ", 5) != 0) { > > + if ((!memcmp(line, "TCP4 ", 5)) != 0) { > > u32 src3, dst3, sport, dport; > > > > line += 5; > > @@ -426,7 +426,7 @@ int conn_recv_proxy(struct connection *conn, int > flag) > > ((struct sockaddr_in *)>addr.to)->sin_port > = htons(dport); > > conn->flags |= CO_FL_ADDR_FROM_SET | CO_FL_ADDR_TO_SET; > > } > > - else if (!memcmp(line, "TCP6 ", 5) != 0) { > > + else if ((!memcmp(line, "TCP6 ", 5)) != 0) { > > u32 sport, dport; > > char *src_s; > > char *dst_s, *sport_s, *dport_s; > > Well, these fixes make the code even uglier than what it was. Please note > that these ones were already fixed some time ago by this patch > > commit 42ff05e2d3d10e8a1e070e66e8883c5eabe196d7 > Author: David CARLIER <devne...@gmail.com> > Date: Thu Mar 24 09:22:36 2016 + > > CLEANUP: connection: fix double negation on memcmp() > > Nothing harmful in here, just clarify that it applies to the whole > expression. > > I'm noticing that I didn't backport this patch, I should pick it. > > Thanks, > Willy >
Minor - patch 1.6.x - Fix some warnings in Connection.c
These warnings bother me. -- *Jonathan S. Fisher* Senior Software Engineer https://twitter.com/exabrial http://www.tomitribe.com https://www.tomitribe.io diff --git a/src/connection.c b/src/connection.c index 991cae3..12cdef0 100644 --- a/src/connection.c +++ b/src/connection.c @@ -385,7 +385,7 @@ int conn_recv_proxy(struct connection *conn, int flag) if (trash.len < 9) /* shortest possible line */ goto missing; - if (!memcmp(line, "TCP4 ", 5) != 0) { + if ((!memcmp(line, "TCP4 ", 5)) != 0) { u32 src3, dst3, sport, dport; line += 5; @@ -426,7 +426,7 @@ int conn_recv_proxy(struct connection *conn, int flag) ((struct sockaddr_in *)>addr.to)->sin_port = htons(dport); conn->flags |= CO_FL_ADDR_FROM_SET | CO_FL_ADDR_TO_SET; } - else if (!memcmp(line, "TCP6 ", 5) != 0) { + else if ((!memcmp(line, "TCP6 ", 5)) != 0) { u32 sport, dport; char *src_s; char *dst_s, *sport_s, *dport_s;
License questions
Hey guys, Reading through the license, I had a couple of questions. HAProxy does not speak AJP, which is not terrible, but I was thinking about implementing a module for it. If I did, I would want the license to be ASL. If I pull in the development headers from HAProxy, would that present a license conflict? -- *Jonathan S. Fisher* Senior Software Engineer https://twitter.com/exabrial http://www.tomitribe.com https://www.tomitribe.io
Re: Compilation problem: haproxy 1.6.5 (latest) on Solaris 11
You guys are great. Thanks for the information and the patch On Fri, May 20, 2016 at 12:37 AM, Willy Tarreau <w...@1wt.eu> wrote: > with the attachment it's better :-) > > On Fri, May 20, 2016 at 06:37:05AM +0200, Willy Tarreau wrote: > > Hi Jonathan, > > > > On Wed, May 18, 2016 at 01:52:01PM -0400, Jonathan Fisher wrote: > > > Nice here's the complication output: > > > > > > > > > http://pastebin.com/iS2JKXED > > > > > > Now I just have to figure out how to add openssl, zlib, and libpcre > which > > > don't seem to be available on Oracle Solaris. > > > > Normally it should also work with the attached patch which I'd prefer to > > merge for long-term safety. > > > > Regarding the other packages you need above, when I was working on > Solaris > > I used to pick them from sunfreeware.com, they used to work out of the > box. > > > > Regards, > > Willy > -- *Jonathan S. Fisher* Senior Software Engineer https://twitter.com/exabrial http://www.tomitribe.com https://www.tomitribe.io
Re: Compilation problem: haproxy 1.6.5 (latest) on Solaris 11
Cool, thanks! Where is the git repo for haproxy? having trouble finding the official one, all I can find is a mirror on github. On Thu, May 19, 2016 at 1:33 AM, Vincent Bernatwrote: > ❦ 18 mai 2016 22:56 +0200, Pavlos Parissis : > > >> Also, where is the bugtracker for haproxy? I can file a report if you > >> want to save time. > > > > As far as I know there isn't any bugtracker. Posting problems in this > > ML is enough to kick the investigation. So far this model works quite > > well > > Yes, Willy will notice the patch at some point and maybe merge it if > he's OK with it. > -- > Habit is habit, and not to be flung out of the window by any man, but > coaxed > down-stairs a step at a time. > -- Mark Twain, "Pudd'nhead Wilson's Calendar > -- *Jonathan S. Fisher* Senior Software Engineer https://twitter.com/exabrial http://www.tomitribe.com https://www.tomitribe.io
Re: Compilation problem: haproxy 1.6.5 (latest) on Solaris 11
Also, where is the bugtracker for haproxy? I can file a report if you want to save time. On Wed, May 18, 2016 at 1:52 PM, Jonathan Fisher <jfis...@tomitribe.com> wrote: > Nice here's the complication output: > > > http://pastebin.com/iS2JKXED > > Now I just have to figure out how to add openssl, zlib, and libpcre which > don't seem to be available on Oracle Solaris. > > On Wed, May 18, 2016 at 1:40 PM, Vincent Bernat <ber...@luffy.cx> wrote: > >> You can try this patch to check if it works. >> >> >> >> -- >> Let the data structure the program. >> - The Elements of Programming Style (Kernighan & Plauger) >> >> ――― Original Message ――― >> From: Jonathan Fisher <jfis...@tomitribe.com> >> Sent: 18 mai 2016 12:56 -0400 >> Subject: Re: Compilation problem: haproxy 1.6.5 (latest) on Solaris 11 >> To: Vincent Bernat >> Cc: haproxy@formilux.org >> >> >> > Oh man, I wish I was smart enough to understand what's happening >> > there... what do I need to replace? (And for my own learning/benefit, >> > can you explain what's happening?) >> > >> > Thank you!!! >> > >> > On Wed, May 18, 2016 at 12:07 PM, Vincent Bernat <ber...@luffy.cx> >> > wrote: >> > >> > Hey! >> > >> > Since there is some discrepancy in the definition of ntohll among >> > platforms, I define this macro to shadow any existing definition: >> > >> > #ifndef ntohll >> > # define ntohll(x) \ >> > (((u_int64_t)(ntohl((int)(((x) << 32) >> 32))) << 32) | \ >> > (unsigned int)ntohl(((int)((x) >> 32)))) >> > #endif >> > >> > You can try yourself. Or if you don't know what to replace, I can >> > provide a patch. >> > -- >> > Don't compare floating point numbers just for equality. >> > - The Elements of Programming Style (Kernighan & Plauger) >> > >> > ――― Original Message ――― >> > From: Jonathan Fisher <jfis...@tomitribe.com> >> > Sent: 18 mai 2016 10:22 -0400 >> > Subject: Compilation problem: haproxy 1.6.5 (latest) on Solaris 11 >> > To: haproxy@formilux.org >> > >> > >> > >> > > We can get 1.5 to compile quite nicely on Solaris 11 :) 1.6 has >> > a few >> > > nice features though we'd like to have, if it all possible. I >> > have a >> > > VMDK created if the developers want to try it themselves in a >> > virtual >> > > machine. >> > > >> > > Here is the output of the compiler, which is GCC-48: >> > > >> > > user@tomee:~/haproxy-1.6.5$ gmake TARGET=solaris >> > > gcc -Iinclude -Iebtree -Wall -O2 -g -fno-strict-aliasing - >> > > Wdeclaration-after-statement -fomit-frame-pointer - >> > DFD_SETSIZE=65536 - >> > > D_REENTRANT -DTPROXY -DCONFIG_HAP_CRYPT -DNEED_CRYPT_H - >> > > DUSE_GETADDRINFO -DENABLE_POLL - >> > DCONFIG_HAPROXY_VERSION=\"1.6.5\" - >> > > DCONFIG_HAPROXY_DATE=\"2016/05/10\" \ >> > > -DBUILD_TARGET='"solaris"' \ >> > > -DBUILD_ARCH='""' \ >> > > -DBUILD_CPU='"generic"' \ >> > > -DBUILD_CC='"gcc"' \ >> > > -DBUILD_CFLAGS='"-O2 -g -fno-strict-aliasing - >> > > Wdeclaration-after-statement -fomit-frame-pointer - >> > DFD_SETSIZE=65536 - >> > > D_REENTRANT"' \ >> > > -DBUILD_OPTIONS='""' \ >> > > -c -o src/haproxy.o src/haproxy.c >> > > In file included from include/common/ticks.h:56:0, >> > > from include/proto/proxy.h:26, >> > > from include/common/cfgparse.h:30, >> > > from src/haproxy.c:63: >> > > include/common/standard.h:1013:34: error: static declaration of >> > > 'htonll' follows non-static declaration >> > > static inline unsigned long long htonll(unsigned long long a) >> > > ^ >> > > In file included from /usr/include/netinet/in.h:73:0, >> > > from /usr/include/sys/socket.h:29, >> > > from src/haproxy.c:36: >> > > /usr/include/sys/byteorder.h:75:17: note: previous declaration >> > of >> > > 'htonll' was here >> > &
Re: Compilation problem: haproxy 1.6.5 (latest) on Solaris 11
Nice here's the complication output: http://pastebin.com/iS2JKXED Now I just have to figure out how to add openssl, zlib, and libpcre which don't seem to be available on Oracle Solaris. On Wed, May 18, 2016 at 1:40 PM, Vincent Bernat <ber...@luffy.cx> wrote: > You can try this patch to check if it works. > > > > -- > Let the data structure the program. > - The Elements of Programming Style (Kernighan & Plauger) > > ――― Original Message ――― > From: Jonathan Fisher <jfis...@tomitribe.com> > Sent: 18 mai 2016 12:56 -0400 > Subject: Re: Compilation problem: haproxy 1.6.5 (latest) on Solaris 11 > To: Vincent Bernat > Cc: haproxy@formilux.org > > > Oh man, I wish I was smart enough to understand what's happening > > there... what do I need to replace? (And for my own learning/benefit, > > can you explain what's happening?) > > > > Thank you!!! > > > > On Wed, May 18, 2016 at 12:07 PM, Vincent Bernat <ber...@luffy.cx> > > wrote: > > > > Hey! > > > > Since there is some discrepancy in the definition of ntohll among > > platforms, I define this macro to shadow any existing definition: > > > > #ifndef ntohll > > # define ntohll(x) \ > > (((u_int64_t)(ntohl((int)(((x) << 32) >> 32))) << 32) | \ > > (unsigned int)ntohl(((int)((x) >> 32 > > #endif > > > > You can try yourself. Or if you don't know what to replace, I can > > provide a patch. > > -- > > Don't compare floating point numbers just for equality. > > - The Elements of Programming Style (Kernighan & Plauger) > > > > ――― Original Message ――― > > From: Jonathan Fisher <jfis...@tomitribe.com> > > Sent: 18 mai 2016 10:22 -0400 > > Subject: Compilation problem: haproxy 1.6.5 (latest) on Solaris 11 > > To: haproxy@formilux.org > > > > > > > > > We can get 1.5 to compile quite nicely on Solaris 11 :) 1.6 has > > a few > > > nice features though we'd like to have, if it all possible. I > > have a > > > VMDK created if the developers want to try it themselves in a > > virtual > > > machine. > > > > > > Here is the output of the compiler, which is GCC-48: > > > > > > user@tomee:~/haproxy-1.6.5$ gmake TARGET=solaris > > > gcc -Iinclude -Iebtree -Wall -O2 -g -fno-strict-aliasing - > > > Wdeclaration-after-statement -fomit-frame-pointer - > > DFD_SETSIZE=65536 - > > > D_REENTRANT -DTPROXY -DCONFIG_HAP_CRYPT -DNEED_CRYPT_H - > > > DUSE_GETADDRINFO -DENABLE_POLL - > > DCONFIG_HAPROXY_VERSION=\"1.6.5\" - > > > DCONFIG_HAPROXY_DATE=\"2016/05/10\" \ > > > -DBUILD_TARGET='"solaris"' \ > > > -DBUILD_ARCH='""' \ > > > -DBUILD_CPU='"generic"' \ > > > -DBUILD_CC='"gcc"' \ > > > -DBUILD_CFLAGS='"-O2 -g -fno-strict-aliasing - > > > Wdeclaration-after-statement -fomit-frame-pointer - > > DFD_SETSIZE=65536 - > > > D_REENTRANT"' \ > > > -DBUILD_OPTIONS='""' \ > > > -c -o src/haproxy.o src/haproxy.c > > > In file included from include/common/ticks.h:56:0, > > > from include/proto/proxy.h:26, > > > from include/common/cfgparse.h:30, > > > from src/haproxy.c:63: > > > include/common/standard.h:1013:34: error: static declaration of > > > 'htonll' follows non-static declaration > > > static inline unsigned long long htonll(unsigned long long a) > > > ^ > > > In file included from /usr/include/netinet/in.h:73:0, > > > from /usr/include/sys/socket.h:29, > > > from src/haproxy.c:36: > > > /usr/include/sys/byteorder.h:75:17: note: previous declaration > > of > > > 'htonll' was here > > > extern uint64_t htonll(uint64_t); > > > ^ > > > In file included from include/common/ticks.h:56:0, > > > from include/proto/proxy.h:26, > > > from include/common/cfgparse.h:30, > > > from src/haproxy.c:63: > > > include/common/standard.h:1028:34: error: static declaration of > > > 'ntohll' follows non-static declaration > > > static inline unsigned long long ntohll(unsigned long long a) > > > ^ > > > In file included from /usr/include/netinet/in.h:73:0, > > > from /usr/include/sys/socket.h:29, > > > from src/haproxy.c:36: > > > /usr/include/sys/byteorder.h:76:17: note: previous declaration > > of > > > 'ntohll' was here > > > extern uint64_t ntohll(uint64_t); > > > ^ > > > gmake: *** [src/haproxy.o] Error 1 > > > user@tomee:~/haproxy-1.6.5$ > > > > > > cheers, > > -- *Jonathan S. Fisher* Senior Software Engineer https://twitter.com/exabrial http://www.tomitribe.com https://www.tomitribe.io
Re: Compilation problem: haproxy 1.6.5 (latest) on Solaris 11
Oh man, I wish I was smart enough to understand what's happening there... what do I need to replace? (And for my own learning/benefit, can you explain what's happening?) Thank you!!! On Wed, May 18, 2016 at 12:07 PM, Vincent Bernat <ber...@luffy.cx> wrote: > Hey! > > Since there is some discrepancy in the definition of ntohll among > platforms, I define this macro to shadow any existing definition: > > #ifndef ntohll > # define ntohll(x) \ > (((u_int64_t)(ntohl((int)(((x) << 32) >> 32))) << 32) | \ > (unsigned int)ntohl(((int)((x) >> 32 > #endif > > You can try yourself. Or if you don't know what to replace, I can > provide a patch. > -- > Don't compare floating point numbers just for equality. > - The Elements of Programming Style (Kernighan & Plauger) > > ――― Original Message ――― > From: Jonathan Fisher <jfis...@tomitribe.com> > Sent: 18 mai 2016 10:22 -0400 > Subject: Compilation problem: haproxy 1.6.5 (latest) on Solaris 11 > To: haproxy@formilux.org > > > We can get 1.5 to compile quite nicely on Solaris 11 :) 1.6 has a few > > nice features though we'd like to have, if it all possible. I have a > > VMDK created if the developers want to try it themselves in a virtual > > machine. > > > > Here is the output of the compiler, which is GCC-48: > > > > user@tomee:~/haproxy-1.6.5$ gmake TARGET=solaris > > gcc -Iinclude -Iebtree -Wall -O2 -g -fno-strict-aliasing - > > Wdeclaration-after-statement -fomit-frame-pointer -DFD_SETSIZE=65536 - > > D_REENTRANT -DTPROXY -DCONFIG_HAP_CRYPT -DNEED_CRYPT_H - > > DUSE_GETADDRINFO -DENABLE_POLL -DCONFIG_HAPROXY_VERSION=\"1.6.5\" - > > DCONFIG_HAPROXY_DATE=\"2016/05/10\" \ > > -DBUILD_TARGET='"solaris"' \ > > -DBUILD_ARCH='""' \ > > -DBUILD_CPU='"generic"' \ > > -DBUILD_CC='"gcc"' \ > > -DBUILD_CFLAGS='"-O2 -g -fno-strict-aliasing - > > Wdeclaration-after-statement -fomit-frame-pointer -DFD_SETSIZE=65536 - > > D_REENTRANT"' \ > > -DBUILD_OPTIONS='""' \ > > -c -o src/haproxy.o src/haproxy.c > > In file included from include/common/ticks.h:56:0, > > from include/proto/proxy.h:26, > > from include/common/cfgparse.h:30, > > from src/haproxy.c:63: > > include/common/standard.h:1013:34: error: static declaration of > > 'htonll' follows non-static declaration > > static inline unsigned long long htonll(unsigned long long a) > > ^ > > In file included from /usr/include/netinet/in.h:73:0, > > from /usr/include/sys/socket.h:29, > > from src/haproxy.c:36: > > /usr/include/sys/byteorder.h:75:17: note: previous declaration of > > 'htonll' was here > > extern uint64_t htonll(uint64_t); > > ^ > > In file included from include/common/ticks.h:56:0, > > from include/proto/proxy.h:26, > > from include/common/cfgparse.h:30, > > from src/haproxy.c:63: > > include/common/standard.h:1028:34: error: static declaration of > > 'ntohll' follows non-static declaration > > static inline unsigned long long ntohll(unsigned long long a) > > ^ > > In file included from /usr/include/netinet/in.h:73:0, > > from /usr/include/sys/socket.h:29, > > from src/haproxy.c:36: > > /usr/include/sys/byteorder.h:76:17: note: previous declaration of > > 'ntohll' was here > > extern uint64_t ntohll(uint64_t); > > ^ > > gmake: *** [src/haproxy.o] Error 1 > > user@tomee:~/haproxy-1.6.5$ > > > > cheers, > -- *Jonathan S. Fisher* Senior Software Engineer https://twitter.com/exabrial http://www.tomitribe.com https://www.tomitribe.io
Compilation problem: haproxy 1.6.5 (latest) on Solaris 11
We can get 1.5 to compile quite nicely on Solaris 11 :) 1.6 has a few nice features though we'd like to have, if it all possible. I have a VMDK created if the developers want to try it themselves in a virtual machine. Here is the output of the compiler, which is GCC-48: user@tomee:~/haproxy-1.6.5$ gmake TARGET=solaris gcc -Iinclude -Iebtree -Wall -O2 -g -fno-strict-aliasing -Wdeclaration-after-statement -fomit-frame-pointer -DFD_SETSIZE=65536 -D_REENTRANT -DTPROXY -DCONFIG_HAP_CRYPT -DNEED_CRYPT_H -DUSE_GETADDRINFO -DENABLE_POLL -DCONFIG_HAPROXY_VERSION=\"1.6.5\" -DCONFIG_HAPROXY_DATE=\"2016/05/10\" \ -DBUILD_TARGET='"solaris"' \ -DBUILD_ARCH='""' \ -DBUILD_CPU='"generic"' \ -DBUILD_CC='"gcc"' \ -DBUILD_CFLAGS='"-O2 -g -fno-strict-aliasing -Wdeclaration-after-statement -fomit-frame-pointer -DFD_SETSIZE=65536 -D_REENTRANT"' \ -DBUILD_OPTIONS='""' \ -c -o src/haproxy.o src/haproxy.c In file included from include/common/ticks.h:56:0, from include/proto/proxy.h:26, from include/common/cfgparse.h:30, from src/haproxy.c:63: include/common/standard.h:1013:34: error: static declaration of 'htonll' follows non-static declaration static inline unsigned long long htonll(unsigned long long a) ^ In file included from /usr/include/netinet/in.h:73:0, from /usr/include/sys/socket.h:29, from src/haproxy.c:36: /usr/include/sys/byteorder.h:75:17: note: previous declaration of 'htonll' was here extern uint64_t htonll(uint64_t); ^ In file included from include/common/ticks.h:56:0, from include/proto/proxy.h:26, from include/common/cfgparse.h:30, from src/haproxy.c:63: include/common/standard.h:1028:34: error: static declaration of 'ntohll' follows non-static declaration static inline unsigned long long ntohll(unsigned long long a) ^ In file included from /usr/include/netinet/in.h:73:0, from /usr/include/sys/socket.h:29, from src/haproxy.c:36: /usr/include/sys/byteorder.h:76:17: note: previous declaration of 'ntohll' was here extern uint64_t ntohll(uint64_t); ^ gmake: *** [src/haproxy.o] Error 1 user@tomee:~/haproxy-1.6.5$ cheers, -- *Jonathan S. Fisher* Senior Software Engineer https://twitter.com/exabrial http://www.tomitribe.com https://www.tomitribe.io