]> git.kaiwu.me - haproxy.git/log
haproxy.git
16 years ago[BUG] config: fix erroneous check on cookie domain names
Willy Tarreau [Thu, 3 Dec 2009 22:10:56 +0000 (23:10 +0100)]
[BUG] config: fix erroneous check on cookie domain names

It was a OR instead of a AND, so it was required to have a cookie
name which contained a dot AND began with a dot.
(cherry picked from commit a1e107fc13e5d8886bf900f302322bfa6ed35d37)

16 years ago[BUG/CLEANUP] cookiedomain -> cookie_domain rename + free(p->cookie_domain)
Krzysztof Piotr Oledzki [Thu, 29 May 2008 21:03:34 +0000 (23:03 +0200)]
[BUG/CLEANUP] cookiedomain -> cookie_domain rename + free(p->cookie_domain)

Rename cookiedomain -> cookie_domain to be consistent with current
naming scheme. Also make sure cookie_domain is deallocated at deinit()
(cherry picked from commit 1acf2173669e2b82060412b2100943054ed620d5)

16 years ago[MINOR] Allow to specify a domain for a cookie
Krzysztof Piotr Oledzki [Fri, 23 May 2008 21:49:32 +0000 (23:49 +0200)]
[MINOR] Allow to specify a domain for a cookie

This patch allows to specify a domain used when inserting a cookie
providing a session stickiness. Usefull for example with wildcard domains.

The patch adds one new variable to the struct proxy: cookiedomain.
When set the domain is appended to a Set-Cookie header.

Domain name is validated using the new invalid_domainchar() function.
It is basically invalid_char() limited to [A-Za-z0-9_.-]. Yes, the test
is too trivial and does not cover all wrong situations, but the main
purpose is to detect most common mistakes, not intentional abuses.

The underscore ("_") character is not RFC-valid but as it is
often (mis)used so I decided to allow it.
(cherry picked from commit efe3b6f524c5cc6328233941ca44247993342d71)

16 years ago[DOC] trivial fix for man page
Michael Shuler [Wed, 14 Oct 2009 15:23:03 +0000 (10:23 -0500)]
[DOC] trivial fix for man page

I'm working on helping Arnaud update haproxy in Debian, and one of the
package build warnings I received was about "hyphen where a minus sign
was intended" in the man page - details:
http://lintian.debian.org/tags/hyphen-used-as-minus-sign.html

Patch included in my 1.3.20 Debian package is attached.

(cherry picked from commit 35928e84e2766dc8310dea2b0062365bde0e65c9)
(cherry picked from commit 95f1d3eaf38690ab069e8dbb9e0f95083a15bb09)

16 years ago[DOC] add a reminder about obsolete documents
Willy Tarreau [Wed, 14 Oct 2009 18:30:15 +0000 (20:30 +0200)]
[DOC] add a reminder about obsolete documents

haproxy-en.txt and haproxy-fr.txt are outdated but people still refer to
them quite often, generally causing a useless waste of time.
(cherry picked from commit a080eca533c860f038e848274a38ad91dc951df4)
[wt: updated links to point to doc for version 1.3.15]
(cherry picked from commit 7b4652e599840a5126de268cd7c8785be72d49fb)

16 years ago[BUILD] use "git cmd" instead of "git-cmd"
Willy Tarreau [Thu, 23 Jul 2009 11:43:33 +0000 (13:43 +0200)]
[BUILD] use "git cmd" instead of "git-cmd"

Newer GIT versions do not support "git-cmd" anymore, so date and version
can be wrong during development builds. Use "git cmd" now. Also fix
git-tar to use "git archive" instead of "git-tar-tree".
(cherry picked from commit 63076b3f611803a9bf9e6012193f89d14ccc32d2)

[wt: finally decided to merge it into 1.3.15.x because packaging
 backports was becoming an annoying experience].
(cherry picked from commit e68f64fd01d5c4fd561a82642f112bd5376bb8df)

16 years ago[RELEASE] Released version 1.3.15.10 v1.3.15.10
Willy Tarreau [Mon, 27 Jul 2009 19:59:15 +0000 (21:59 +0200)]
[RELEASE] Released version 1.3.15.10

Released version 1.3.15.10 with the following main changes :
    - [MINOR] startup: don't imply -q with -D
    - [BUG] ensure that we correctly re-start old process in case of error
    - [BUILD] report commit date and not author's date as build date
    - [BUG] stream_sock: don't stop reading when the poller reports an error
    - [CLEANUP] report 2009 not 2008 in the copyright banner.
    - [BUILD] fix incorrect printf arg count with tcp_splice

16 years ago[BUILD] fix incorrect printf arg count with tcp_splice
Willy Tarreau [Sun, 26 Jul 2009 18:40:05 +0000 (20:40 +0200)]
[BUILD] fix incorrect printf arg count with tcp_splice

remove an extra arg.
(cherry picked from commit bc69d8bbcf80ab8721449636e274a691f117680f)

16 years ago[CLEANUP] report 2009 not 2008 in the copyright banner.
Willy Tarreau [Thu, 23 Jul 2009 11:45:47 +0000 (13:45 +0200)]
[CLEANUP] report 2009 not 2008 in the copyright banner.

(cherry picked from commit b455691af393f831ab44c70b605fd45e7ca0967b)
(cherry picked from commit b98fd681793db08df3217163554c15cbacec216e)

16 years ago[BUG] stream_sock: don't stop reading when the poller reports an error
Willy Tarreau [Tue, 14 Jul 2009 17:55:05 +0000 (19:55 +0200)]
[BUG] stream_sock: don't stop reading when the poller reports an error

As reported by Jean-Baptiste Quenot and Robbie Aelter, sometimes a
backend server error is converted to a 502 error if the backend stops
before reading all the request. The reason is that the remote system
sends a TCP RST packet because there are still unread data pending in
the socket buffer. This RST is translated as a socket error on the
local system, and this error is reported by the poller.

However, most of the time, it's a write error, but the system is
still able to read the remaining pending data, such as in the trace
below :

send(7, "GET /aaa HTTP/1.0\r\nUser-Agent: Mo"..., 1123, MSG_DONTWAIT|MSG_NOSIGNAL) = 1123
epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLIN, {u32=7, u64=7}}) = 0
epoll_wait(3, {{EPOLLIN|EPOLLERR|EPOLLHUP, {u32=7, u64=7}}}, 8, 1000) = 1
gettimeofday({1247593958, 643572}, NULL) = 0
recv(7, "HTTP/1.0 400 Bad request\r\nCache-C"..., 7000, MSG_NOSIGNAL) = 187
setsockopt(6, SOL_TCP, TCP_NODELAY, [0], 4) = 0
setsockopt(6, SOL_TCP, TCP_CORK, [1], 4) = 0
send(6, "HTTP/1.0 400 Bad request\r\nCache-C"..., 187, MSG_DONTWAIT|MSG_NOSIGNAL) = 187
shutdown(6, 1 /* send */)               = 0

The recv succeeded while epoll_wait() reported an error.

Note: This case is very hard to reproduce and requires that the backend
server is reached via the loopback in order to minimise latency and
reduce the risk of sent data being ACKed.
(cherry picked from commit 7154365cc60b124b543db4e98faedc75c0f3a2cb)

16 years ago[BUILD] report commit date and not author's date as build date
Willy Tarreau [Tue, 14 Jul 2009 11:24:16 +0000 (13:24 +0200)]
[BUILD] report commit date and not author's date as build date

By default, when building from a git tree, haproxy's release date is
set to the last commit's date. But it was the wrong date which was
used, the initial patch's date, which can cause time jumps in the
past when an old patch gets merged. What we want is the commit date,
which reflects the correct code history.
(cherry picked from commit 446024e7fb5faef86cd6e2c0aba3c4524ad77705)

16 years ago[BUG] ensure that we correctly re-start old process in case of error
Willy Tarreau [Tue, 9 Jun 2009 12:36:00 +0000 (14:36 +0200)]
[BUG] ensure that we correctly re-start old process in case of error

When a new process fails to grab some ports, it sends a signal to
the old process in order to release them. Then it tries to bind
again. If it still fails (eg: one of the ports is bound to a
completely different process), it must send the continue signal
to the old process so that this one re-binds to the ports. This
is correctly done, but the newly bound ports are not released
first, which sometimes causes the old process to remain running
with no port bound. The fix simply consists in unbinding all
ports before sending the signal to the old process.
(cherry picked from commit f68da4603a092f35af627c459dbc714d9fa796e9)
(cherry picked from commit f20cad6b3214f2b1b3db7fbeeecc0ef109185c2d)

16 years ago[MINOR] startup: don't imply -q with -D
Willy Tarreau [Mon, 18 May 2009 14:29:51 +0000 (16:29 +0200)]
[MINOR] startup: don't imply -q with -D

It is recommended to have -D in init scripts, but -D also implies
quiet mode, which hides warning messages, and both options are now
completely unrelated. Remove the implication to get warnings with
-D.
(cherry picked from commit b885b7eb6e12b0f0cfd2fa7d692830e696dabe68)

17 years ago[RELEASE] Released version 1.3.15.9 v1.3.15.9
Willy Tarreau [Sun, 10 May 2009 18:38:06 +0000 (20:38 +0200)]
[RELEASE] Released version 1.3.15.9

Released version 1.3.15.9 with the following main changes :
    - [BUILD] Fixed Makefile for linking pcre
    - [CONTRIB] selinux policy for haproxy
    - [DOC] Make the status listener example complete.
    - [BUILD] spec file: fix broken pipe during rpmbuild and add man file
    - [BUG] server check intervals must not be null
    - [BUG] check for global.maxconn before doing accept()
    - [BUILD] add format(printf) to printf-like functions
    - [MINOR] fix several printf formats and missing arguments
    - [BUG] stats: total and lbtot are unsigned
    - [MINOR] fix a few remaining printf-like formats on 64-bit platforms
    - [MEDIUM] ensure we don't recursively call pool_gc2()
    - [CRITICAL] uninitialized response field can sometimes cause crashes
    - [MINOR] rhel init script : support the reload operation
    - [BUG] O(1) pollers should check their FD before closing it
    - [MINOR] don't close stdio fds twice
    - [MINOR] stats/html: use the arial font before helvetica

17 years ago[MINOR] stats/html: use the arial font before helvetica
Willy Tarreau [Sun, 10 May 2009 18:08:10 +0000 (20:08 +0200)]
[MINOR] stats/html: use the arial font before helvetica

The stats HTML output were barely readable on some browsers such as
firefox on Linux, due to the selected helvetica font which is too
small. Specifying "arial" first fixes the issue without changing the
table size. Also, the default size of 0.8em choosen to get 10px out
of 12px is wrong because it gets 9px when rounded down.
(cherry picked from commit a94f2d2ef944e3f54f50e938ff3c8de1a021f7ff)

17 years ago[MINOR] don't close stdio fds twice
Willy Tarreau [Sun, 10 May 2009 08:33:29 +0000 (10:33 +0200)]
[MINOR] don't close stdio fds twice

This minor harmless bug dates back to v1.1. When fclose() was added,
the close() calls were not removed, so the fds 0,1,2 are closed twice.
(cherry picked from commit 1700b9c3d5f06ac283ab2e254bd64b1bc7a207ca)

17 years ago[BUG] O(1) pollers should check their FD before closing it
Willy Tarreau [Sun, 10 May 2009 08:18:54 +0000 (10:18 +0200)]
[BUG] O(1) pollers should check their FD before closing it

[cherry-picked from commit d79e79b436144654d10124de7d5fd4c896ac0487]

epoll, sepoll and kqueue pollers should check that their fd is not
closed before attempting to close it, otherwise we can end up with
multiple closes of fd #0 upon exit, which is harmless but dirty.

17 years ago[MINOR] rhel init script : support the reload operation
Willy Tarreau [Fri, 1 May 2009 13:49:56 +0000 (15:49 +0200)]
[MINOR] rhel init script : support the reload operation

The reload operation in the Red Hat init script caused a restart
which is not always the best thing to do. Implement the reload.
(cherry picked from commit 3909a2ab008e9fed1851bc68d5b6ff23c62c0a1e)

17 years ago[CRITICAL] uninitialized response field can sometimes cause crashes
Willy Tarreau [Mon, 27 Apr 2009 06:11:33 +0000 (08:11 +0200)]
[CRITICAL] uninitialized response field can sometimes cause crashes

[cherry-picked from commit 79e998919660b2ec6d5dc11be9d820c5c1965460]

The response message in the transaction structure was not properly
initialised at session initialisation. In theory it cannot cause any
trouble since the affected field os expected to always remain NULL.
However, in some circumstances, such as building on 64-bit platforms
with certain options, the struct session can be exactly 1024 bytes,
the same size of the requri field, so the pools are merged and the
uninitialised field may contain non-null data, causing crashes if
an invalid response is encountered and archived.

The fix simply consists in correctly initialising the missing fields.
This bug cannot affect architectures where the session pool is not
shared (32-bit architectures), but this is only by pure luck.

17 years ago[MEDIUM] ensure we don't recursively call pool_gc2()
Willy Tarreau [Tue, 21 Apr 2009 00:17:45 +0000 (02:17 +0200)]
[MEDIUM] ensure we don't recursively call pool_gc2()

A race condition exists in the hot reconfiguration code. It is
theorically possible that the second signal is sent during a free()
in the first list, which can cause crashes or freezes (the later
have been observed). Just set up a counter to ensure we do not
recurse.
(cherry picked from commit b7f9d126e269f3b5b7dc05e39fcf207ba86a330c)

17 years ago[MINOR] fix a few remaining printf-like formats on 64-bit platforms
Willy Tarreau [Sat, 11 Apr 2009 17:42:49 +0000 (19:42 +0200)]
[MINOR] fix a few remaining printf-like formats on 64-bit platforms

Mainly two sizeof() returning size_t which is not the size of an int
on 64-bit platforms.
(cherry picked from commit 5e4a6f13f4b3c3de0e533284d5fabd9b4bbe00cc)

17 years ago[BUG] stats: total and lbtot are unsigned
Willy Tarreau [Tue, 7 Apr 2009 11:27:40 +0000 (13:27 +0200)]
[BUG] stats: total and lbtot are unsigned

Some big users are seeing negative numbers in the CSV stats. This patch
needs to be backported to 1.3.15 and extended to the HTML part.

17 years ago[BUILD] spec file: fix broken pipe during rpmbuild and add man file
Sébastien Barrier [Thu, 2 Apr 2009 13:09:35 +0000 (15:09 +0200)]
[BUILD] spec file: fix broken pipe during rpmbuild and add man file

(cherry picked from commit f1a09bde577a5fe2ff8499a61e6ca26c5b0c6b49)

17 years ago[MINOR] fix several printf formats and missing arguments
Willy Tarreau [Fri, 3 Apr 2009 12:49:12 +0000 (14:49 +0200)]
[MINOR] fix several printf formats and missing arguments

[cherry-picked from commit 1772ece0252fa517ace6c554ee77ca09c3dda7e8]

Last patch revealed a number of mistakes in printf-like calls, mostly int/long
mismatches, and a few missing arguments.

17 years ago[BUILD] add format(printf) to printf-like functions
Willy Tarreau [Fri, 3 Apr 2009 10:01:47 +0000 (12:01 +0200)]
[BUILD] add format(printf) to printf-like functions

[cherry-picked from commit 40d251637126d8104943ddb6e8c6b1790caf7159]

Doing this helps catching warnings about wrong output formats.

17 years ago[BUG] check for global.maxconn before doing accept()
Willy Tarreau [Sat, 21 Mar 2009 21:43:12 +0000 (22:43 +0100)]
[BUG] check for global.maxconn before doing accept()

[cherry-picked from commit b00f9c456c0eadd26abbbf4bb0a3276da9f1844e]

If the accept() is done before checking for global.maxconn, we can
accept too many connections and encounter a lack of file descriptors
when trying to connect to the server. This is the cause of the
"cannot get a server socket" message  encountered in debug mode
during injections with low timeouts.

17 years ago[BUG] server check intervals must not be null
Willy Tarreau [Sat, 21 Mar 2009 17:58:32 +0000 (18:58 +0100)]
[BUG] server check intervals must not be null

[cherry-picked from commit e38388033f3df181ff6a2ee227789cd743d17dc1]

If server check interval is null, we might end up looping in
process_srv_chk().

Prevent those values from being zero and add some control in
process_srv_chk() against infinite loops.

17 years ago[DOC] Make the status listener example complete.
Jan-Frode Myklebust [Mon, 16 Mar 2009 12:24:45 +0000 (13:24 +0100)]
[DOC] Make the status listener example complete.

The example for configuration of "Status report in HTML page"
in haproxy-en.txt/haproxy-fr.txt is incomplete. Gives me the
below error, and had me scratching my head a bit :-)

[ALERT] 074/131807 (26359) : parsing /etc/haproxy/haproxy.cfg : listener
stats has no dispatch address and is not in transparent or balance mode.
[ALERT] 074/131807 (26359) : Errors found in configuration file, aborting.
[ALERT] 074/131807 (26359) : Error reading configuration file :
/etc/haproxy/haproxy.cfg

If adding "balance roundrobin" to the stats stanza is the right fix,
please apply the attached documentation patch to haproxy v1.2 and v1.3.

[w@1wt.eu: this is the right fix up to 1.3.15, not needed in 1.3.16]

17 years ago[BUILD] Fixed Makefile for linking pcre
Christian Wiese [Thu, 20 Nov 2008 13:47:04 +0000 (14:47 +0100)]
[BUILD] Fixed Makefile for linking pcre

If both make parameters USE_PCRE and USE_STATIC_PCRE are set to 1
while building haproxy, pcre gets linked in dynamically.

Therefore we check if USE_STATIC_PCRE was explicitely enabled to
ommit the CFLAGS and LDFLAGS normally set if USE_PCRE is enabled.
(cherry picked from commit c820300adf36700cbbff15249a8629baa63c5f5a)

17 years ago[CONTRIB] selinux policy for haproxy
Jan-Frode Myklebust [Tue, 17 Mar 2009 20:26:43 +0000 (21:26 +0100)]
[CONTRIB] selinux policy for haproxy

Here's an selinux policy for haproxy. The patch is built and lightly
tested with haproxy-1.3.15.7-1.fc10.i386 on Fedora9, and haproxy-1.2.18
on RHEL5.
(cherry picked from commit 6b6a53db5f135d8256dd1a8c9dab018963ed6918)

17 years ago[RELEASE] Released version 1.3.15.8 v1.3.15.8
Willy Tarreau [Sun, 8 Mar 2009 22:23:50 +0000 (23:23 +0100)]
[RELEASE] Released version 1.3.15.8

Released version 1.3.15.8 with the following main changes :
    - [BUG] Fix listen & more of 2 couples <ip>:<port>
    - [DOC] remove buggy comment for use_backend
    - [CRITICAL] fix server state tracking: it was O(n!) instead of O(n)
    - [BUG] "option transparent" is for backend, not frontend !
    - [BUG] we must not exit if protocol binding only returns a warning
    - [BUG] inform the user when root is expected but not set
    - [DOC] large doc update backported from mainline
    - [BUG] the "source" keyword must first clear optional settings
    - [BUG] global.tune.maxaccept must be limited even in mono-process mode
    - [BUG] typo in timeout error reporting : report *res and not *err

17 years ago[BUG] typo in timeout error reporting : report *res and not *err
Willy Tarreau [Fri, 6 Mar 2009 07:05:40 +0000 (08:05 +0100)]
[BUG] typo in timeout error reporting : report *res and not *err
(cherry picked from commit bb9251ed8fc4e79c40f5b4459d20cecb4428fb1c)

17 years ago[BUG] global.tune.maxaccept must be limited even in mono-process mode
Willy Tarreau [Sun, 1 Mar 2009 07:35:41 +0000 (08:35 +0100)]
[BUG] global.tune.maxaccept must be limited even in mono-process mode

On overloaded systems, it sometimes happens that hundreds or thousands
of incoming connections are queued in the system's backlog, and all get
dequeued at once. The problem is that when haproxy processes them and
does not apply any limit, this can take some time and the internal date
does not progress, resulting in wrong timer measures for all sessions.

The most common effect of this is that all of these sessions report a
large request time (around several hundreds of ms) which is in fact
caused by the time spent accepting other connections. This might happen
on shared systems when the machine swaps.

For this reason, we finally apply a reasonable limit even in mono-process
mode. Accepting 100 connections at once is fast enough for extreme cases
and will not cause that much of a trouble when the system is saturated.
(cherry picked from commit f49d1df25cf794b8801d919fda20266d90981c78)

17 years ago[BUG] the "source" keyword must first clear optional settings
Willy Tarreau [Sun, 1 Mar 2009 07:27:21 +0000 (08:27 +0100)]
[BUG] the "source" keyword must first clear optional settings

Problem reported by John Lauro. When "source ... usesrc ..." is
set in the defaults section, it is not possible anymore to remove
the "usesrc" part when declaring a more precise "source" in a
backend. The only workaround was to declare it by server.

We need to clear optional settings when declaring a new "source".
(cherry picked from commit 368480cf4570a0d6448741c704aebd53ac467aa9)

17 years ago[DOC] large doc update backported from mainline
Willy Tarreau [Sun, 1 Mar 2009 07:16:53 +0000 (08:16 +0100)]
[DOC] large doc update backported from mainline

Several parts in the doc were incomplete, mainly about logging. Some
inaccuracies have also been fixed. The old manual should not be needed
anymore.

17 years ago[BUG] inform the user when root is expected but not set
Willy Tarreau [Wed, 4 Feb 2009 17:02:48 +0000 (18:02 +0100)]
[BUG] inform the user when root is expected but not set

When a plain user runs haproxy as non-root but some options require
root, let's inform him.
(cherry picked from commit 4e30ed73f4b902b076f765c3e2370ef0a034a648)

17 years ago[BUG] we must not exit if protocol binding only returns a warning
Willy Tarreau [Wed, 4 Feb 2009 16:05:23 +0000 (17:05 +0100)]
[BUG] we must not exit if protocol binding only returns a warning

Right now, protocol binding cannot return a warning, but when this
will happen, we must not exit but just print the warning.
(cherry picked from commit 0a3b9d90d3570cb618c7008cd1d7348d48a3868c)

17 years ago[BUG] "option transparent" is for backend, not frontend !
Willy Tarreau [Tue, 23 Dec 2008 22:13:55 +0000 (23:13 +0100)]
[BUG] "option transparent" is for backend, not frontend !

"option transparent" was set and checked on frontends only while it
is purely a backend thing as it replaces the "balance" mode. For this
reason, it did only work in "listen" sections. This change will then
not affect the rare users of this option.
(cherry picked from commit 4b1f85912c5dfd7e53dfa31d3e9dd3113747c702)

17 years ago[CRITICAL] fix server state tracking: it was O(n!) instead of O(n)
Krzysztof Piotr Oledzki [Thu, 29 Jan 2009 23:52:49 +0000 (00:52 +0100)]
[CRITICAL] fix server state tracking: it was O(n!) instead of O(n)

Using the wrong operator (&& instead of &) causes DOWN->UP
transition to take longer than it should and to produce a lot of
redundant logs. With typical "track" usage (1-6 tracking servers) it
shouldn't make a big difference but for heavily tracked servers
this bug leads to hang with 100% CPU usage and extremely big
log spam.

17 years ago[DOC] remove buggy comment for use_backend
Krzysztof Piotr Oledzki [Tue, 27 Jan 2009 20:09:41 +0000 (21:09 +0100)]
[DOC] remove buggy comment for use_backend

"early blocking based on ACLs" is definitely wrong here

17 years ago[BUG] Fix listen & more of 2 couples <ip>:<port>
Krzysztof Piotr Oledzki [Tue, 27 Jan 2009 15:57:08 +0000 (16:57 +0100)]
[BUG] Fix listen & more of 2 couples <ip>:<port>

Fix "listen www-mutualise 80.248.x.y1:80,80.248.x.y2:80,80.248.x.y3:80":

[ALERT] 309/161509 (15450) : Invalid server address: '80.248.x.y1:80,80.248.x.y2'
[ALERT] 309/161509 (15450) : Error reading configuration file : /etc/haproxy/haproxy.cfg

Bug reported by Laurent Dolosor.

17 years ago[RELEASE] Released version 1.3.15.7 v1.3.15.7
Willy Tarreau [Thu, 4 Dec 2008 10:29:13 +0000 (11:29 +0100)]
[RELEASE] Released version 1.3.15.7

Released version 1.3.15.7 with the following main changes :
    - [BUILD] fix MANDIR default location to match documentation
    - [BUG] critical errors should be reported even in daemon mode
    - [BUG] do not dequeue requests on a dead server
    - [BUG] do not dequeue the backend's pending connections on a dead server

17 years ago[BUG] do not dequeue the backend's pending connections on a dead server
Willy Tarreau [Thu, 4 Dec 2008 08:33:58 +0000 (09:33 +0100)]
[BUG] do not dequeue the backend's pending connections on a dead server

Kai Krueger found that previous patch was incomplete, because there is
an unconditionnal call to process_srv_queue() in session_free() which
still causes a dead server to consume pending connections from the
backend.

This call was made unconditionnal so that we don't leave unserved
connections in the server queue, for instance connections coming
in with "option persist" which can bypass the server status check.
However, the server must not touch the backend's queue if it is down.

Another fear was that some connections might remain unserved when
the server is using a dynamic maxconn if the number of connections
to the backend is too low. Right now, srv_dynamic_maxconn() ensures
this cannot happen, so the call can remain conditionnal.

The fix consists in allowing a server to process it own queue whatever
its state, but not to touch the backend's queue if it is down. Its
queue should normally be empty when the server is down because it is
redistributed when the server goes down. The only remaining cases are
precisely the persistent connections with "option persist" set, coming
in after the queue has been redispatched. Those ones must still be
processed when a connection terminates.

17 years ago[BUG] do not dequeue requests on a dead server
Willy Tarreau [Sun, 30 Nov 2008 20:51:58 +0000 (21:51 +0100)]
[BUG] do not dequeue requests on a dead server

Kai Krueger reported a problem when a server goes down with active
connections. A lot of connections were drained by that server. Kai
did an amazing job at tracking this bug down to the dequeuing
mechanism which forgets to check the server state before allowing
a request to be sent to a server.

The problem occurs more often with long requests, which have a chance
to complete after the server is completely marked down, and to find
requests in the global queue which have not yet been fetched by other
servers.

The fix consists in ensuring that a server is up before sending it
any new request from the queue.

17 years ago[BUG] critical errors should be reported even in daemon mode
Willy Tarreau [Sun, 16 Nov 2008 06:40:34 +0000 (07:40 +0100)]
[BUG] critical errors should be reported even in daemon mode

Josh Goebel reported that haproxy silently dies when it fails to
chroot. In fact, it does so when in daemon mode, because daemon
mode has been disabling output for ages.

Since the code has been reworked, this could have been changed
because there is no reason for this anymore, hence this patch.

17 years ago[BUILD] fix MANDIR default location to match documentation
Jeremy Hinegardner [Sun, 16 Nov 2008 00:29:03 +0000 (17:29 -0700)]
[BUILD] fix MANDIR default location to match documentation

I found this while building for Fedora.

17 years ago[RELEASE] Released version 1.3.15.6 v1.3.15.6
Willy Tarreau [Tue, 4 Nov 2008 09:54:14 +0000 (10:54 +0100)]
[RELEASE] Released version 1.3.15.6

Released version 1.3.15.6 with the following main changes :
    - [MINOR] cfgparse: fix off-by 2 in error message size
    - [BUG] cookie capture is declared in the frontend but checked on the backend

17 years ago[BUG] cookie capture is declared in the frontend but checked on the backend
Willy Tarreau [Fri, 17 Oct 2008 10:01:58 +0000 (12:01 +0200)]
[BUG] cookie capture is declared in the frontend but checked on the backend

Cookie capture would only work by pure luck on the request but did
never work on responses since only the backend was checked. The fix
consists in always checking frontend for cookie captures.
(cherry picked from commit a83c5ba9315a7c47cda2698280b7e49a9d3eb374)

17 years ago[MINOR] cfgparse: fix off-by 2 in error message size
Jeffrey 'jf' Lim [Sat, 4 Oct 2008 16:07:00 +0000 (18:07 +0200)]
[MINOR] cfgparse: fix off-by 2 in error message size

was just looking through the source, and noticed this... :)

17 years ago[RELEASE] Released version 1.3.15.5 v1.3.15.5
Willy Tarreau [Sun, 12 Oct 2008 20:44:43 +0000 (22:44 +0200)]
[RELEASE] Released version 1.3.15.5

Released version 1.3.15.5 with the following main changes :
    - [BUG] do not try to pause backends during reload
    - [BUG] ensure that listeners from disabled proxies are correctly unbound.
    - [BUG] acl-related keywords are not allowed in defaults sections

17 years ago[BUG] acl-related keywords are not allowed in defaults sections
Willy Tarreau [Sun, 12 Oct 2008 15:26:37 +0000 (17:26 +0200)]
[BUG] acl-related keywords are not allowed in defaults sections

Using an ACL-related keyword in the defaults section causes a
segfault during parsing because the list headers are not initialized.
We must initialize list headers for default instance and reject
keywords relying on ACLs.

17 years ago[BUG] ensure that listeners from disabled proxies are correctly unbound.
Willy Tarreau [Sun, 12 Oct 2008 10:07:48 +0000 (12:07 +0200)]
[BUG] ensure that listeners from disabled proxies are correctly unbound.

There is a problem when an instance is marked "disabled". Its ports are
still bound but will not be unbound upon termination. This causes processes
to accumulate during soft restarts, and might even cause failures to restart
new ones due to the inability to bind to the same port.

The ideal solution would be to bind all ports at the end of the configuration
parsing. An acceptable workaround is to unbind all listeners of disabled
proxies. This is what the current patch does.

17 years ago[BUG] do not try to pause backends during reload
Willy Tarreau [Fri, 10 Oct 2008 15:51:34 +0000 (17:51 +0200)]
[BUG] do not try to pause backends during reload

During a configuration reload, haproxy tried to pause all proxies.
Unfortunately, it also tried to pause backends, which would fail
and cause trouble to the new process since the port was still bound.

17 years ago[RELEASE] Released version 1.3.15.4 v1.3.15.4
Willy Tarreau [Sun, 14 Sep 2008 16:42:28 +0000 (18:42 +0200)]
[RELEASE] Released version 1.3.15.4

Released version 1.3.15.4 with the following main changes :
    - [BUG] do not release the connection slot during a retry
    - [BUG] dynamic connection throttling could return a max of zero conns

17 years ago[BUG] dynamic connection throttling could return a max of zero conns
Willy Tarreau [Sun, 14 Sep 2008 15:43:27 +0000 (17:43 +0200)]
[BUG] dynamic connection throttling could return a max of zero conns

srv_dynamic_maxconn() is clearly documented as returning at least 1
possible connection under throttling. But the computation was wrong,
the minimum 1 was divided and got lost in case of very low maxconns.

Apply the MAX(1, max) before returning the result in order to ensure
that a newly appeared server will get some traffic.

17 years ago[BUG] do not release the connection slot during a retry
Willy Tarreau [Sun, 14 Sep 2008 15:40:09 +0000 (17:40 +0200)]
[BUG] do not release the connection slot during a retry

A bug was introduced during last queue management fix. If a server
connection fails, the allocated connection slot is released, but it
will be needed again after the turn-around. This also causes more
connections than expected to go to the server because it appears to
have less connections than real.

Many thanks to Rupert Fiasco, Mark Imbriaco, Cody Fauser, Brian
Gupta and Alexander Staubo for promptly providing configuration
and diagnosis elements to help reproduce this problem easily.

17 years ago[RELEASE] Released version 1.3.15.3 v1.3.15.3
Willy Tarreau [Tue, 2 Sep 2008 09:32:34 +0000 (11:32 +0200)]
[RELEASE] Released version 1.3.15.3

Released version 1.3.15.3 with the following main changes :
    - [BUG] disable buffer read timeout when reading stats
    - [BUILD] change declaration of base64tab to fix build with Intel C++
    - [BUILD] silent a warning in unlikely() with gcc 4.x
    - [BUG] use_backend would not correctly consider "unless"
    - [CLEANUP] remove dependency on obsolete INTBITS macro
    - [BUG] fix segfault with url_param + check_post
    - [BUG] server timeout was not considered in some circumstances
    - [BUG] ev_sepoll: closed file descriptors could persist in the spec list
    - [BUG] maintain_proxies must not disable backends
    - [BUG] regparm is broken on gcc < 3
    - [OPTIM] force inlining of large functions with gcc >= 3

17 years ago[OPTIM] force inlining of large functions with gcc >= 3
Willy Tarreau [Fri, 29 Aug 2008 13:48:49 +0000 (15:48 +0200)]
[OPTIM] force inlining of large functions with gcc >= 3

GCC 3 and above do not inline large functions, which is a problem
with ebtree where most core functions are inlined.

This simple patch has both reduced code size and increased speed.
It should be back-ported to ebtree.
(cherry picked from commit 707d3da01f8475d5c172d347a73bd9e947076df6)

17 years ago[BUG] regparm is broken on gcc < 3
Willy Tarreau [Sun, 17 Aug 2008 15:06:37 +0000 (17:06 +0200)]
[BUG] regparm is broken on gcc < 3

Gcc < 3 does not consider regparm declarations for function pointers.
This causes big trouble at least with pollers (and with any function
pointer after all). Disable CONFIG_HAP_USE_REGPARM for gcc < 3.
(cherry picked from commit 61eadc028fb8774ea05d893cd3eca6c671fb511e)

17 years ago[BUG] maintain_proxies must not disable backends
Willy Tarreau [Sat, 16 Aug 2008 16:41:13 +0000 (18:41 +0200)]
[BUG] maintain_proxies must not disable backends

maintain_proxies could disable backends (p->maxconn == 0) which is
wrong (but apparently harmless). Add a check for p->maxconn == 0.
(cherry picked from commit d5382b4aaa099ce5ce2af5828bd4d6dc38e9e8ea)

17 years ago[BUG] ev_sepoll: closed file descriptors could persist in the spec list
Willy Tarreau [Sat, 16 Aug 2008 14:06:02 +0000 (16:06 +0200)]
[BUG] ev_sepoll: closed file descriptors could persist in the spec list

If __fd_clo() was called on a file descriptor which was previously
disabled, it was not removed from the spec list. This apparently
could not happen on previous code because the TCP states prevented
this, but now it happens regularly. The effects are spec entries
stuck populated, leading to busy loops.

(cherry picked from commit 7a52a5c4680477272b2f34eaf5896b85746e6fd6)

17 years ago[BUG] server timeout was not considered in some circumstances
Willy Tarreau [Mon, 11 Aug 2008 08:35:07 +0000 (10:35 +0200)]
[BUG] server timeout was not considered in some circumstances

Due to a copy-paste typo, the client timeout was refreshed instead
of the server's when waiting for server response. This means that
the server's timeout remained eternity.

(cherry picked from commit 9f1f24bb7fb8ebd6b43b5fee1bda0afbdbcb768e)

17 years ago[BUG] fix segfault with url_param + check_post
Willy Tarreau [Sun, 10 Aug 2008 22:21:56 +0000 (00:21 +0200)]
[BUG] fix segfault with url_param + check_post

If an HTTP/0.9-like POST request is sent to haproxy while
configured with url_param + check_post, it will crash. The
reason is that the total buffer length was computed based
on req->total (which equals the number of bytes read) and
not req->l (number of bytes in the buffer), thus leading
to wrong size calculations when calling memchr().

The affected code does not look like it could have been
exploited to run arbitrary code, only reads were performed
at wrong locations.
(cherry picked from commit fb0528bd56063e9800c7dd6fbd96b3c5c6a687f2)

17 years ago[CLEANUP] remove dependency on obsolete INTBITS macro
Willy Tarreau [Mon, 14 Jul 2008 22:36:31 +0000 (00:36 +0200)]
[CLEANUP] remove dependency on obsolete INTBITS macro

The INTBITS macro was found to be already defined on some platforms,
and to equal 32 (while INTBITS was 5 here). Due to pure luck, there
was no declaration conflict, but it's nonetheless a problem to fix.

Looking at the code showed that this macro was only used for left
shifts and nothing else anymore. So the replacement is obvious. The
new macro, BITS_PER_INT is more obviously correct.
(cherry picked from commit 177e2b012723ef65c6c7f850df3e6e0cd2cca2b4)

17 years ago[BUG] use_backend would not correctly consider "unless"
Willy Tarreau [Wed, 9 Jul 2008 09:23:31 +0000 (11:23 +0200)]
[BUG] use_backend would not correctly consider "unless"

A copy-paste typo made use_backend not correctly consider the "unless"
case, depending on the previous "block" rule.
(cherry picked from commit a8cfa34a9c011cecfaedfaf7d91de3e5f7f004a0)

17 years ago[BUILD] silent a warning in unlikely() with gcc 4.x
Willy Tarreau [Sun, 6 Jul 2008 13:18:50 +0000 (15:18 +0200)]
[BUILD] silent a warning in unlikely() with gcc 4.x

The unlikely() implementation for gcc 4.x spits out a warning
when a pointer is passed. Add a cast to unsigned long.
(cherry picked from commit 75875a7c8c7348e90e373c007bafdedcc6253ab4)

17 years ago[BUILD] change declaration of base64tab to fix build with Intel C++
Willy Tarreau [Sun, 29 Jun 2008 15:17:38 +0000 (17:17 +0200)]
[BUILD] change declaration of base64tab to fix build with Intel C++

I got a report that Intel C++ complains about the size of the
base64tab in base64.c. Setting it to 65 chars to allow for the
trailing zero fixes the problem.
(cherry picked from commit 69e989ccbcc1d5cbb623493d6c9cca169fb36ff6)

17 years ago[BUG] disable buffer read timeout when reading stats
Willy Tarreau [Sun, 29 Jun 2008 14:38:43 +0000 (16:38 +0200)]
[BUG] disable buffer read timeout when reading stats

The buffer read timeouts were not reset when stats were produced. This
caused unneeded wakeups.
(cherry picked from commit 284c7b319566a66d5b742c905072175aac6445e1)

17 years ago[RELEASE] Released version 1.3.15.2 v1.3.15.2
Willy Tarreau [Sat, 21 Jun 2008 19:59:05 +0000 (21:59 +0200)]
[RELEASE] Released version 1.3.15.2

Released version 1.3.15.2 with the following main changes :
    - [BUILD] make install should depend on haproxy not "all"
    - [BUG] event pollers must not wait if a task exists in the run queue
    - [BUG] queue management: wake oldest request in queues
    - [BUG] log: reported queue position was offed-by-one
    - [BUG] fix the dequeuing logic to ensure that all requests get served
    - [DOC] documentation for the "retries" parameter was missing.

17 years ago[DOC] documentation for the "retries" parameter was missing.
Willy Tarreau [Fri, 20 Jun 2008 15:27:19 +0000 (17:27 +0200)]
[DOC] documentation for the "retries" parameter was missing.

17 years ago[BUG] fix the dequeuing logic to ensure that all requests get served
Willy Tarreau [Fri, 20 Jun 2008 13:04:11 +0000 (15:04 +0200)]
[BUG] fix the dequeuing logic to ensure that all requests get served

The dequeuing logic was completely wrong. First, a task was assigned
to all servers to process the queue, but this task was never scheduled
and was only woken up on session free. Second, there was no reservation
of server entries when a task was assigned a server. This means that
as long as the task was not connected to the server, its presence was
not accounted for. This was causing trouble when detecting whether or
not a server had reached maxconn. Third, during a redispatch, a session
could lose its place at the server's and get blocked because another
session at the same moment would have stolen the entry. Fourth, the
redispatch option did not work when maxqueue was reached for a server,
and it was not possible to do so without indefinitely hanging a session.

The root cause of all those problems was the lack of pre-reservation of
connections at the server's, and the lack of tracking of servers during
a redispatch. Everything relied on combinations of flags which could
appear similarly in quite distinct situations.

This patch is a major rework but there was no other solution, as the
internal logic was deeply flawed. The resulting code is cleaner, more
understandable, uses less magics and is overall more robust.

As an added bonus, "option redispatch" now works when maxqueue has
been reached on a server.

17 years ago[BUG] log: reported queue position was offed-by-one
Willy Tarreau [Fri, 13 Jun 2008 19:48:18 +0000 (21:48 +0200)]
[BUG] log: reported queue position was offed-by-one

The reported queue position in the logs was 0 for the first pending request
in the queue, which is wrong because it means that one request will have to
be completed before the queued one may execute. It caused the undesired side
effect that 0/0 was reported when either 0 or 1 request was pending in the
queue. Thus, we have to increment the queue size before reporting the value.

17 years ago[BUG] queue management: wake oldest request in queues
Willy Tarreau [Fri, 13 Jun 2008 19:12:51 +0000 (21:12 +0200)]
[BUG] queue management: wake oldest request in queues

When a server terminates a connection, the next session in its
own queue was immediately processed. Because of this, if all
server queues are always filled, then no new anonymous request
will be processed. Consider oldest request between global and
server queues to choose from which to pick the request.

An improvement over this will consist in adding a configurable
offset when comparing expiration dates, so that cookie-less
requests can get either less or more priority.

17 years ago[BUG] event pollers must not wait if a task exists in the run queue
Willy Tarreau [Fri, 13 Jun 2008 19:06:56 +0000 (21:06 +0200)]
[BUG] event pollers must not wait if a task exists in the run queue

Under some circumstances, a task may already lie in the run queue
(eg: inter-task wakeup). It is disastrous to wait for an event in
this case because some processing gets delayed.

17 years ago[BUILD] make install should depend on haproxy not "all"
Willy Tarreau [Wed, 11 Jun 2008 22:25:46 +0000 (00:25 +0200)]
[BUILD] make install should depend on haproxy not "all"

Reported by Cherife Li : just doing a "make install" fails because it
depends on "all" which is equivalent to "help" if no TARGET was specified.
Make it depend on "haproxy" instead.

17 years ago[RELEASE] Released version 1.3.15.1 v1.3.15.1
Willy Tarreau [Sun, 25 May 2008 19:12:58 +0000 (21:12 +0200)]
[RELEASE] Released version 1.3.15.1

Released version 1.3.15.1 with the following main changes :
    - [BUILD] fix build with gcc 4.3
    - [TESTS] add a debug patch to help trigger the stats bug
    - [BUG] Flush buffers also where there are exactly 0 bytes left
    - [DOC] update the README file with new build options
    - [MEDIUM] reduce risk of event starvation in ev_sepoll

17 years ago[MEDIUM] reduce risk of event starvation in ev_sepoll
Willy Tarreau [Sun, 25 May 2008 08:39:02 +0000 (10:39 +0200)]
[MEDIUM] reduce risk of event starvation in ev_sepoll

If too many events are set for spec I/O, those ones can starve the
polled events. Experiments show that when polled events starve, they
quickly turn into spec I/O, making the situation even worse. While
we can reduce the number of polled events processed at once, we
cannot do this on speculative events because most of them are new
ones (avg 2/3 new - 1/3 old from experiments).

The solution against this problem relies on those two factors :
  1) one FD registered as a spec event cannot be polled at the same time
  2) even during very high loads, we will almost never be interested in
     simultaneous read and write streaming on the same FD.

The first point implies that during starvation, we will not have more than
half of our FDs in the poll list, otherwise it means there is less than that
in the spec list, implying there is no starvation.

The second point implies that we're statically only interested in half of
the maximum number of file descriptors at once, because we will unlikely
have simultaneous read and writes for a same buffer during long periods.

So, if we make it possible to drain maxsock/2/2 during peak loads, then we
can ensure that there will be no starvation effect. This means that we must
always allocate maxsock/4 events for the poller.

Last, sepoll uses an optimization consisting in reducing the number of calls
to epoll_wait() to once every too polls. However, when dealing with many
spec events, we can wait very long and skipping epoll_wait() every second
time increases latency. For this reason, we try to detect if we are beyond
a reasonable limit and stop doing so at this stage.

17 years ago[DOC] update the README file with new build options
Willy Tarreau [Sun, 25 May 2008 08:32:50 +0000 (10:32 +0200)]
[DOC] update the README file with new build options

17 years ago[BUILD] fix build with gcc 4.3
Jeremy Hinegardner [Mon, 21 Apr 2008 05:34:31 +0000 (07:34 +0200)]
[BUILD] fix build with gcc 4.3

For Fedora 9 gcc 4.3 will be shipping as a feature, and right now haproxy does
not compile with gcc 4.3.

It appears that there is a reordering of headers or something along those lines,
This is the patch that gets haproxy to compile with gcc 4.3.  I'm not sure if
this is the correct approach you would want to use, so please correct me.

If this works for you, I'll go ahead and put this patch in the src rpm until a
release of haproxy which compiles with gcc 4.3 is released.

17 years ago[TESTS] add a debug patch to help trigger the stats bug
Krzysztof Oledzki [Mon, 21 Apr 2008 05:28:21 +0000 (07:28 +0200)]
[TESTS] add a debug patch to help trigger the stats bug

About: [BUG] Flush buffers also where there are exactly 0 bytes left

I'm also attaching a debug patch that helps to trigger this bug.

Without the fix:
# echo -ne "GET /haproxy?stats;csv;norefresh HTTP/1.0\r\n\r\n"|nc 127.0.0.1
801|wc -c
16384

With the fix:
# echo -ne "GET /haproxy?stats;csv;norefresh HTTP/1.0\r\n\r\n"|nc 127.0.0.1
801|wc -c
33089

Best regards,

                                Krzysztof Oledzki

17 years ago[BUG] Flush buffers also where there are exactly 0 bytes left
Krzysztof Piotr Oledzki [Sun, 20 Apr 2008 19:34:47 +0000 (21:34 +0200)]
[BUG] Flush buffers also where there are exactly 0 bytes left

I noticed it was possible to get truncated http/csv stats. Sometimes.
Usually the problem disappeared as fast as it appeared, but once it
happend that my http-stats page was truncated for about one hour.
It was quite weird as it happened independently for csv and http
output and it took me some time to track & fix this bug.

Both buffer_write & buffer_write_chunk used to return 0 in two
situations: is case of success or where there was exactly 0 bytes
left. The first one is intentional but I believe the second one
is not as it was not possible to distinguish between successful
write and unsuccessful one, which means that if the buffer was 100%
filled, it was never flushed and it was not possible to write
more data.

This patch fixes this problem.

18 years ago[RELEASE] Released version 1.3.15 v1.3.15
Willy Tarreau [Sat, 19 Apr 2008 19:06:14 +0000 (21:06 +0200)]
[RELEASE] Released version 1.3.15

Released version 1.3.15 with the following main changes :
    - [BUILD] Added support for 'make install'
    - [BUILD] Added 'install-man' make target for installing the man page
    - [BUILD] Added 'install-bin' make target
    - [BUILD] Added 'install-doc' make target
    - [BUILD] Removed "/" after '$(DESTDIR)' in install targets
    - [BUILD] Changed 'install' target to install the binaries first
    - [BUILD] Replace hardcoded 'LD = gcc' with 'LD = $(CC)'
    - [MEDIUM]: Inversion for options
    - [MEDIUM]: Count retries and redispatches also for servers, fix redistribute_pending, extend logs, %d->%u cleanup
    - [BUG]: Restore clearing t->logs.bytes
    - [MEDIUM]: rework checks handling
    - [DOC] Update a "contrib" file with a hint about a scheme used for formathing subjects
    - [MEDIUM] Implement "track [<backend>/]<server>"
    - [MINOR] Implement persistent id for proxies and servers
    - [BUG] Don't increment server connections too much + fix retries
    - [MEDIUM]: Prevent redispatcher from selecting the same server, version #3
    - [MAJOR] proto_uxst rework -> SNMP support
    - [BUG] appsession lookup in URL does not work
    - [BUG] transparent proxy address was ignored in backend
    - [BUG] hot reconfiguration failed because of a wrong error check
    - [DOC] big update to the configuration manual
    - [DOC] large update to the configuration manual
    - [DOC] document more options
    - [BUILD] major rework of the GNU Makefile
    - [STATS] add support for "show info" on the unix socket
    - [DOC] document options forwardfor to logasap
    - [MINOR] add support for the "backlog" parameter
    - [OPTIM] introduce global parameter "tune.maxaccept"
    - [MEDIUM] introduce "timeout http-request" in frontends
    - [MINOR] tarpit timeout is also allowed in backends
    - [BUG] increment server connections for each connect()
    - [MEDIUM] add a turn-around state of one second after a connection failure
    - [BUG] fix typo in redispatched connection
    - [DOC] document options nolinger to ssl-hello-chk
    - [DOC] added documentation for "option tcplog" to "use_backend"
    - [BUG] connect_server: server might not exist when sending error report
    - [MEDIUM] support fully transparent proxy on Linux (USE_LINUX_TPROXY)
    - [MEDIUM] add non-local bind to connect() on Linux
    - [MINOR] add transparent proxy support for balabit's Tproxy v4
    - [BUG] use backend's source and not server's source with tproxy
    - [BUG] fix overlapping server flags
    - [MEDIUM] fix server health checks source address selection
    - [BUG] build failed on CONFIG_HAP_LINUX_TPROXY without CONFIG_HAP_CTTPROXY
    - [DOC] added "server", "source" and "stats" keywords
    - [DOC] all server parameters have been documented
    - [DOC] document all req* and rsp* keywords.
    - [DOC] added documentation about HTTP header manipulations
    - [BUG] log response byte count, not request
    - [BUILD] code did not build in full debug mode
    - [BUG] fix truncated responses with sepoll
    - [MINOR] use s->frt_addr as the server's address in transparent proxy
    - [MINOR] fix configuration hint about timeouts
    - [DOC] minor cleanup of the doc and notice to contributors
    - [MINOR] report correct section type for unknown keywords.
    - [BUILD] update MacOS Makefile to build on newer versions
    - [DOC] fix erroneous "useallbackups" option in the doc
    - [DOC] applied small fixes from early readers
    - [MINOR] add configuration support for "redir" server keyword
    - [MEDIUM] completely implement the server redirection method
    - [TESTS] add a test case for the server redirection mechanism
    - [DOC] add a configuration entry for "server ... redir <prefix>"
    - [BUILD] backend.c and checks.c did not build without tproxy !
    - Revert "[BUILD] backend.c and checks.c did not build without tproxy !"
    - [BUILD] backend.c and checks.c did not build without tproxy !
    - [OPTIM] used unsigned ints for HTTP state and message offsets
    - [OPTIM] GCC4's builtin_expect() is suboptimal
    - [BUG] failed conns were sometimes incremented in the frontend!
    - [BUG] timeout.check was not pre-set to eternity
    - [TESTS] add test-pollers.cfg to easily report pollers in use
    - [BUG] do not apply timeout.connect in checks if unset
    - [BUILD] ensure that makefile understands USE_DLMALLOC=1
    - [MINOR] silent gcc for a wrong warning
    - [CLEANUP] update .gitignore to ignore more temporary files
    - [CLEANUP] report dlmalloc's source path only if explictly specified
    - [BUG] str2sun could leak a small buffer in case of error during parsing
    - [BUG] option allbackups was not working anymore in roundrobin mode
    - [MAJOR] implementation of the "leastconn" load balancing algorithm
    - [BUILD] ensure that users don't build without setting the target anymore.
    - [DOC] document the leastconn LB algo
    - [MEDIUM] fix stats socket limitation to 16 kB
    - [DOC] fix unescaped space in httpchk example.
    - [BUG] fix double-decrement of server connections
    - [TESTS] add a test case for port mapping
    - [TESTS] add a benchmark for integer hashing
    - [TESTS] add new methods in ip-hash test file
    - [MAJOR] implement parameter hashing for POST requests

18 years ago[BUILD] fix build of POST analysis code with gcc < 3
Willy Tarreau [Sat, 19 Apr 2008 19:24:56 +0000 (21:24 +0200)]
[BUILD] fix build of POST analysis code with gcc < 3

move variable declarations at beginning of blocks.

18 years ago[MAJOR] implement parameter hashing for POST requests
matt.farnsworth@nokia.com [Mon, 14 Apr 2008 18:47:37 +0000 (20:47 +0200)]
[MAJOR] implement parameter hashing for POST requests

This patch extends the "url_param" load balancing method by introducing
the "check_post" option. Using this option enables analysis of the beginning
of POST requests to search for the specified URL parameter.

The patch also fixes a few minor typos in comments that were discovered
during code review.

18 years ago[TESTS] add new methods in ip-hash test file
Willy Tarreau [Sun, 13 Apr 2008 07:27:00 +0000 (09:27 +0200)]
[TESTS] add new methods in ip-hash test file

added methods to provide a better hash with small input sets

18 years ago[TESTS] add a benchmark for integer hashing
Willy Tarreau [Sat, 12 Apr 2008 20:28:32 +0000 (22:28 +0200)]
[TESTS] add a benchmark for integer hashing

If we want to support netmasks for IP address hashing,
we will need something better than a pure modulus, otherwise
people with even numbers of servers will get surprizes.

Bob Jenkins is known for his works on hashing, and his site
has a lot of very interesting researches and algorithms for
integer hashing. He also points to the work of Thomas Wang
who has similar findings.

The program here tests their algorithms in order to find one
well suited for IP address hashing.

18 years ago[TESTS] add a test case for port mapping
Willy Tarreau [Sat, 12 Apr 2008 09:19:04 +0000 (11:19 +0200)]
[TESTS] add a test case for port mapping

18 years ago[BUG] fix double-decrement of server connections
Willy Tarreau [Fri, 28 Mar 2008 17:09:38 +0000 (18:09 +0100)]
[BUG] fix double-decrement of server connections

If a client does a sudden dirty close (CL_STCLOSE) during a server
connect turn-around, then the number of server connections is
decremented twice. This causes huge problems on the affected
server because when its connection number becomes negative, it
overflows and prevents the server from accepting new connections
due to an apparent saturation.

The fix consists in not decrementing the counter if the server is
in a turn-around state.

18 years ago[DOC] fix unescaped space in httpchk example.
Willy Tarreau [Fri, 21 Mar 2008 19:17:14 +0000 (20:17 +0100)]
[DOC] fix unescaped space in httpchk example.

Lars Braeuer reported a missing space in the example which drives
readers in wrong direction.

18 years ago[BUILD] Replace hardcoded 'LD = gcc' with 'LD = $(CC)'
Christian Wiese [Mon, 17 Mar 2008 17:23:12 +0000 (18:23 +0100)]
[BUILD] Replace hardcoded 'LD = gcc' with 'LD = $(CC)'

haproxy relies on linking the binary using gcc, so there is no real need to
hardcode both (CC and LD). Setting 'LD = $(CC)' will make the build system
a bit more cross-compile friendly because only the right cross-compiler has
to be passed via make.

18 years ago[MEDIUM] fix stats socket limitation to 16 kB
Willy Tarreau [Mon, 17 Mar 2008 20:38:24 +0000 (21:38 +0100)]
[MEDIUM] fix stats socket limitation to 16 kB

Due to the way the stats socket work, it was not possible to
maintain the information related to the command entered, so
after filling a whole buffer, the request was lost and it was
considered that there was nothing to write anymore.

The major reason was that some flags were passed directly
during the first call to stats_dump_raw() instead of being
stored persistently in the session.

To definitely fix this problem, flags were added to the stats
member of the session structure.

A second problem appeared. When the stats were produced, a first
call to client_retnclose() was performed, then one or multiple
subsequent calls to buffer_write_chunks() were done. But once the
stats buffer was full and a reschedule operated, the buffer was
flushed, the write flag cleared from the buffer and nothing was
done to re-arm it.

For this reason, a check was added in the proto_uxst_stats()
function in order to re-call the client FSM when data were added
by stats_dump_raw(). Finally, the whole unix stats dump FSM was
rewritten to avoid all the magics it depended on. It is now
simpler and looks more like the HTTP one.

18 years ago[DOC] document the leastconn LB algo
Willy Tarreau [Mon, 17 Mar 2008 11:07:56 +0000 (12:07 +0100)]
[DOC] document the leastconn LB algo

18 years ago[BUILD] Changed 'install' target to install the binaries first
Christian Wiese [Wed, 12 Mar 2008 16:28:13 +0000 (18:28 +0200)]
[BUILD] Changed 'install' target to install the binaries first

18 years ago[BUILD] Removed "/" after '$(DESTDIR)' in install targets
Christian Wiese [Wed, 12 Mar 2008 16:19:16 +0000 (18:19 +0200)]
[BUILD] Removed "/" after '$(DESTDIR)' in install targets

SBINDIR, MANDIR and DOCDIR use an absolute path

18 years ago[BUILD] Added 'install-doc' make target
Christian Wiese [Wed, 12 Mar 2008 15:24:49 +0000 (17:24 +0200)]
[BUILD] Added 'install-doc' make target

This change is also introducing a new make variable called DOCDIR,
which is set to "$(PREFIX)/doc/haproxy" by default.

18 years ago[BUILD] Added 'install-bin' make target
Christian Wiese [Wed, 12 Mar 2008 14:21:05 +0000 (16:21 +0200)]
[BUILD] Added 'install-bin' make target

18 years ago[BUILD] Added 'install-man' make target for installing the man page
Christian Wiese [Wed, 12 Mar 2008 13:57:54 +0000 (15:57 +0200)]
[BUILD] Added 'install-man' make target for installing the man page

This change is also introducing a new variable in the Makefile called
MANDIR, which is set to "$PREFIX/share/man" by default.

18 years ago[BUILD] Added support for 'make install'
Christian Wiese [Wed, 12 Mar 2008 13:25:35 +0000 (15:25 +0200)]
[BUILD] Added support for 'make install'

To be flexible while installing haproxy following variables have been
added to the Makefile:
- DESTDIR useful i.e. while installing in a sandbox (not set by default)
- PREFIX  defines the default install prefix (default: /usr/local)
- SBINDIR defines the dir the haproxy binary gets installed
  (default: $PREFIX/sbin)

18 years ago[BUILD] ensure that users don't build without setting the target anymore.
Willy Tarreau [Tue, 11 Mar 2008 05:37:39 +0000 (06:37 +0100)]
[BUILD] ensure that users don't build without setting the target anymore.

Too often, people report performance issues on Linux 2.6 because they don't
use the available optimizations. We need to ensure that people are aware of
the available features, and for this, we must force them to choose a target
OS (or "generic"), but at least prevent them from blindly building for a
generic target.

18 years ago[MAJOR] implementation of the "leastconn" load balancing algorithm
Willy Tarreau [Mon, 10 Mar 2008 21:04:20 +0000 (22:04 +0100)]
[MAJOR] implementation of the "leastconn" load balancing algorithm

The new "leastconn" LB algorithm selects the server which has the
least established or pending connections. The weights are considered,
so that a server with a weight of 20 will get twice as many connections
as the server with a weight of 10.

The algorithm respects the minconn/maxconn settings, as well as the
slowstart since it is a dynamic algorithm. It also correctly supports
backup servers (one and all).

It is generally suited for protocols with long sessions (such as remote
terminals and databases), as it will ensure that upon restart, a server
with no connection will take all new ones until its load is balanced
with others.

A test configuration has been added in order to ease regression testing.