]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
17 years ago[DOC] added "server", "source" and "stats" keywords
Willy Tarreau [Wed, 16 Jan 2008 15:17:06 +0000 (16:17 +0100)] 
[DOC] added "server", "source" and "stats" keywords

The documentation now lists all keywords except the req* and rsp*. The
"server" keyword has been documented for mandatory parameters. Specific
settings are still waiting to be written in a dedicated section.

17 years ago[BUG] build failed on CONFIG_HAP_LINUX_TPROXY without CONFIG_HAP_CTTPROXY
Willy Tarreau [Mon, 14 Jan 2008 15:36:15 +0000 (16:36 +0100)] 
[BUG] build failed on CONFIG_HAP_LINUX_TPROXY without CONFIG_HAP_CTTPROXY

changed #ifdef

17 years ago[MEDIUM] fix server health checks source address selection
Willy Tarreau [Sun, 13 Jan 2008 17:40:14 +0000 (18:40 +0100)] 
[MEDIUM] fix server health checks source address selection

The source address selection for health checks did not consider
the new transparent proxy method. Rely on the same unified function
as the other connect() calls.

This patch also fixes a bug by which the proxy's source address was
ignored if cttproxy was used.

17 years ago[BUG] fix overlapping server flags
Willy Tarreau [Sun, 13 Jan 2008 17:12:24 +0000 (18:12 +0100)] 
[BUG] fix overlapping server flags

Server flags SRV_GOINGDOWN, SRV_WARMINGUP were overlapping
SRV_TPROXY_*.

17 years ago[BUG] use backend's source and not server's source with tproxy
Willy Tarreau [Sun, 13 Jan 2008 17:10:06 +0000 (18:10 +0100)] 
[BUG] use backend's source and not server's source with tproxy

copy-paste typo.

17 years ago[MINOR] add transparent proxy support for balabit's Tproxy v4
Willy Tarreau [Sun, 13 Jan 2008 16:37:16 +0000 (17:37 +0100)] 
[MINOR] add transparent proxy support for balabit's Tproxy v4

Balabit's TPROXY version 4 which replaces CTTPROXY provides a similar
API to the previous proxy, but relies on IP_FREEBIND instead of
IP_TRANSPARENT. Let's add it.

17 years ago[MEDIUM] add non-local bind to connect() on Linux
Willy Tarreau [Sun, 13 Jan 2008 15:31:17 +0000 (16:31 +0100)] 
[MEDIUM] add non-local bind to connect() on Linux

Using some Linux kernel patches which add the IP_TRANSPARENT
SOL_IP option , it is possible to bind to a non-local address
on without having resort to any sort of NAT, thus causing no
performance degradation.

This is by far faster and cleaner than the previous CTTPROXY
method. The code has been slightly changed in order to remain
compatible with CTTPROXY as a fallback for the new method when
it does not work.

It is not needed anymore to specify the outgoing source address
for connect, it can remain 0.0.0.0.

17 years ago[MEDIUM] support fully transparent proxy on Linux (USE_LINUX_TPROXY)
Willy Tarreau [Sun, 13 Jan 2008 13:49:51 +0000 (14:49 +0100)] 
[MEDIUM] support fully transparent proxy on Linux (USE_LINUX_TPROXY)

Using some Linux kernel patches, it is possible to redirect non-local
traffic to local sockets when IP forwarding is enabled. In order to
enable this option, we introduce the "transparent" option keyword on
the "bind" command line. It will make the socket reachable by remote
sources even if the destination address does not belong to the machine.

17 years ago[BUG] connect_server: server might not exist when sending error report
Willy Tarreau [Sat, 12 Jan 2008 21:22:34 +0000 (22:22 +0100)] 
[BUG] connect_server: server might not exist when sending error report

In connect_server(), we may send an alert with the server name while
the server might not exist, eg in dispatch mode.

17 years ago[DOC] added documentation for "option tcplog" to "use_backend"
Willy Tarreau [Fri, 11 Jan 2008 15:28:18 +0000 (16:28 +0100)] 
[DOC] added documentation for "option tcplog" to "use_backend"

- options tcplog, tcpsplice and transparent have been documented.
- keywords "srvtimeout", "timeout queue", "timeout server" and
  "timeout tarpit" have been documented
- keywords "transparent" and "use_backend" have been documented

Only "server", "source" and "stats *" remain undocumented

17 years ago[DOC] document options nolinger to ssl-hello-chk
Willy Tarreau [Tue, 8 Jan 2008 18:50:52 +0000 (19:50 +0100)] 
[DOC] document options nolinger to ssl-hello-chk

Options nolinger, persist, smtpchk and ssl-hello-chk have been
documented. All keywords and options up to and including option
tcpka are now documented.

17 years ago[BUG] fix typo in redispatched connection
Willy Tarreau [Sun, 6 Jan 2008 22:46:19 +0000 (23:46 +0100)] 
[BUG] fix typo in redispatched connection

a copy-paste typo was present in the reconnection code responsible
for respatching. The client's FSM would not be re-evaluated if an
error occurred. It looks harmless but better fix it.

17 years ago[MEDIUM] add a turn-around state of one second after a connection failure
Willy Tarreau [Sun, 6 Jan 2008 22:34:21 +0000 (23:34 +0100)] 
[MEDIUM] add a turn-around state of one second after a connection failure

Several users have complained that when haproxy gets a connection
failure due to an active reject from a server, it immediately
retries, often leading to the same situation being repeated until
the retry counter reaches zero.

Now if a connection error shows up, a turn-around state of 1 second
is applied before retrying. This is performed by faking a connection
timeout in order not to touch much code. However, a cleaner method
would involve an extra state.

17 years ago[MEDIUM]: Count retries and redispatches also for servers, fix redistribute_pending...
Krzysztof Piotr Oledzki [Sun, 6 Jan 2008 15:36:16 +0000 (16:36 +0100)] 
[MEDIUM]: Count retries and redispatches also for servers, fix redistribute_pending, extend logs, %d->%u cleanup

This patch extends a little previously added functionality to also
count retries and redispatches for servers. Now it is possible to know
which server causes redispatches as it is not always the same that takes
most retries.

While working with the code I found that redistribute_pending() does not increment
srv->redispatches && be->redispatches. I don't know how to test it but
I think the fix is correct. If not I can withdraw it.

I also extended logs to show how many retries were done and if redispatching
was necessary ('+'). I'm using an additional session flag SN_REDISP to match
redispatched connections. I had to rearrange all defines in session.h to make
more room for it.

The documentation about logs was also fixed a little (sorry, english only),
as current version uses totally different format. BTW: examples are still
outdated, maybe next time...

Finally, I changed %d -> %u for retries/redispatches as those variables
are declared as unsigned.

17 years ago[BUG] increment server connections for each connect()
Willy Tarreau [Mon, 10 Dec 2007 14:05:42 +0000 (15:05 +0100)] 
[BUG] increment server connections for each connect()

It was abnormal to see more connect errors than connect attempts.
This was caused by the fact that the server's connection count was
not incremented for failed connect() attempts.

Now the per-server connections are correctly incremented for each
connect() attempt. This includes the retries too. The number of
connections effectively served by a server will then be :

   srv->cum_sess - srv->errors - srv->warnings

17 years ago[MINOR] tarpit timeout is also allowed in backends
Willy Tarreau [Sun, 6 Jan 2008 12:40:03 +0000 (13:40 +0100)] 
[MINOR] tarpit timeout is also allowed in backends

Since the tarpit action may be set in backends too, its timeout
must be configurable there.

17 years ago[MEDIUM] introduce "timeout http-request" in frontends
Willy Tarreau [Sun, 6 Jan 2008 12:24:40 +0000 (13:24 +0100)] 
[MEDIUM] introduce "timeout http-request" in frontends

In order to offer DoS protection, it may be required to lower the maximum
accepted time to receive a complete HTTP request without affecting the client
timeout. This helps protecting against established connections on which
nothing is sent. The client timeout cannot offer a good protection against
this abuse because it is an inactivity timeout, which means that if the
attacker sends one character every now and then, the timeout will not
trigger. With the HTTP request timeout, no matter what speed the client
types, the request will be aborted if it does not complete in time.

17 years ago[OPTIM] introduce global parameter "tune.maxaccept"
Willy Tarreau [Sun, 6 Jan 2008 10:22:57 +0000 (11:22 +0100)] 
[OPTIM] introduce global parameter "tune.maxaccept"

This new parameter makes it possible to override the default
number of consecutive incoming connections which can be
accepted on a socket. By default it is not limited on single
process mode, and limited to 8 in multi-process mode.

17 years ago[MINOR] add support for the "backlog" parameter
Willy Tarreau [Sun, 6 Jan 2008 09:55:10 +0000 (10:55 +0100)] 
[MINOR] add support for the "backlog" parameter

Add the "backlog" parameter to frontends, to give hints to
the system about the approximate listen backlog desired size.

In order to protect against SYN flood attacks, one solution is
to increase the system's SYN backlog size. Depending on the
system, sometimes it is just tunable via a system parameter,
sometimes it is not adjustable at all, and sometimes the system
relies on hints given by the application at the time of the
listen() syscall. By default, HAProxy passes the frontend's
maxconn value to the listen() syscall. On systems which can
make use of this value, it can sometimes be useful to be able
to specify a different value, hence this backlog parameter.

17 years ago[DOC] document options forwardfor to logasap
Willy Tarreau [Sun, 6 Jan 2008 07:57:02 +0000 (08:57 +0100)] 
[DOC] document options forwardfor to logasap

Options forwardfor, http_proxy, httpchk, httpclose, httplog and logasap
have been documented.

17 years ago[STATS] add support for "show info" on the unix socket
Willy Tarreau [Thu, 3 Jan 2008 09:19:15 +0000 (10:19 +0100)] 
[STATS] add support for "show info" on the unix socket

It is sometimes required to know some informations such as the
process uptime when consulting statistics. This patch adds the
"show info" command to query those informations on the UNIX
socket.

17 years ago[BUILD] major rework of the GNU Makefile
Willy Tarreau [Wed, 2 Jan 2008 19:48:34 +0000 (20:48 +0100)] 
[BUILD] major rework of the GNU Makefile

The build process was getting annoying under some conditions,
especially on platforms which are used to set CFLAGS, as well
as those which set a lot of complex defines. The new Makefile
takes care of this situation by not mixing TARGET, CPU and user
values, and by making privileging the pre-setting of common
variables with the ability to override them.

Now CFLAGS and LDFLAGS are set by default and may be overridden
without the risk of breaking useful defines. Options are better
dealt with, and as a bonus, it was possible to merge the FreeBSD
and OpenBSD targets into the common GNU Makefile.

The report of build options by "haproxy -vv" has been slightly
adapted to the new mode. Options implied by architecture are not
reported, only user-specified options are. It is also possible to
add options which will not be reported in order not to mangle the
output when specifying dirty informations such as URLs...

The Makefile was copiously documented and it should be easier to
build for any target now. Backwards compatibility with older
build processes was kept, and warnings are emitted for deprecated
build options.

17 years ago[DOC] document more options
Willy Tarreau [Fri, 28 Dec 2007 16:42:56 +0000 (17:42 +0100)] 
[DOC] document more options

All options up to and including "forceclose" have been documented.

17 years ago[DOC] large update to the configuration manual
Willy Tarreau [Thu, 27 Dec 2007 17:26:09 +0000 (18:26 +0100)] 
[DOC] large update to the configuration manual

Keywords from "errorloc" to "monitor-uri" inclusive have been added.
Some fixes applied too.

17 years ago[MEDIUM]: Inversion for options
Krzysztof Oledzki [Tue, 25 Dec 2007 01:40:22 +0000 (02:40 +0100)] 
[MEDIUM]: Inversion for options

This patch adds a possibility to invert most of available options by
introducing the "no" keyword, available as an additional prefix.
If it is found arguments are shifted left and an additional flag (inv)
is set.

It allows to use all options from a current defaults section, except
the selected ones, for example:

-- cut here --
defaults
        contimeout      4200
        clitimeout      50000
        srvtimeout      40000
        option contstats

listen stats 1.2.3.4:80
no option contstats
-- cut here --

Currenly inversion works only with the "option" keyword.

The patch also moves last_checks calculation at the end of the readcfgfile()
function and changes "PR_O_FORCE_CLO | PR_O_HTTP_CLOSE" into "PR_O_FORCE_CLO"
in cfg_opts so it is possible to invert forceclose without breaking httpclose
(and vice versa) and to invert tcpsplice in one proxy but to keep a proper
last_checks value when tcpsplice is used in another proxy. Now, the code
checks for PR_O_FORCE_CLO everywhere it checks for PR_O_HTTP_CLOSE.

I also decided to depreciate "redisp" and "redispatch" keywords as it is IMHO
better to use "option redispatch" which can be inverted.

Some useful documentation were added and at the same time I sorted
(alfabetically) all valid options both in the code and the documentation.

17 years ago[DOC] big update to the configuration manual
Willy Tarreau [Mon, 24 Dec 2007 15:55:16 +0000 (16:55 +0100)] 
[DOC] big update to the configuration manual

New in this version is a small intro to HTTP, then a detailed
explanation of the following keywords :

  acl, appsession, balance, bind, block, capture cookie,
  capture request header, capture response header, clitimeout,
  contimeout, cookie, default_backend, disabled, enabled, errorfile,
  http-check disable-on-404, monitor fail, option contstats,
  timeout client, timeout clitimeout, timeout connect,
  timeout contimeout.

Others will be alphabetically added.

17 years ago[BUG] hot reconfiguration failed because of a wrong error check
Willy Tarreau [Thu, 20 Dec 2007 22:05:50 +0000 (23:05 +0100)] 
[BUG] hot reconfiguration failed because of a wrong error check

The error check in return of start_proxies checked for exact ERR_RETRYABLE
but did not consider the return as a bit field. The function returned both
ERR_RETRYABLE and ERR_ALERT, hence the problem.

17 years ago[BUG] transparent proxy address was ignored in backend
Willy Tarreau [Fri, 14 Dec 2007 18:54:43 +0000 (19:54 +0100)] 
[BUG] transparent proxy address was ignored in backend

When the "source x.x.x.x usesrc y.y.y.y" statement was present in a
backend, the y.y.y.y address was fetched from the server instead of
the backend.

17 years ago[RELEASE] Released version 1.3.14 v1.3.14
Willy Tarreau [Thu, 6 Dec 2007 00:25:44 +0000 (01:25 +0100)] 
[RELEASE] Released version 1.3.14

Released version 1.3.14 with the following main changes :
    - New option http_proxy (Alexandre Cassen)
    - add support for "maxqueue" to limit server queue overload (Elijah Epifanov)
    - Check for duplicated conflicting proxies (Krzysztof Oledzki)
    - stats: report server and backend cumulated downtime (Krzysztof Oledzki)
    - use backends only with use_backend directive (Krzysztof Oledzki)
    - Handle long lines properly (Krzysztof Oledzki)
    - Implement and use generic findproxy and relax duplicated proxy check (Krzysztof Oledzki)
    - continous statistics (Krzysztof Oledzki)
    - add support for logging via a UNIX socket (Robert Tsai)
    - fix error checking in strl2ic/strl2uic()
    - fix calls to localtime()
    - provide easier-to-use ultoa_* functions
    - provide easy-to-use limit_r and LIM2A* macros
    - add a simple test for the status page
    - move error codes to common/errors.h
    - silent warning about LIST_* being redefined on OpenBSD
    - add socket address length to the protocols
    - group PR_O_BALANCE_* bits into a checkable value
    - externalize the "balance" option parser to backend.c
    - introduce the "url_param" balance method
    - make default_backend work in TCP mode too
    - disable warning about localtime_r on Solaris
    - adjust error messages about conflicting proxies
    - avoid calling some layer7 functions if not needed
    - simplify error path in event_accept()
    - add an options field to the listeners
    - added a new state to listeners
    - unbind_listener() must use fd_delete() and not close()
    - add a generic unbind_listener() primitive
    - add a generic delete_listener() primitive
    - add a generic unbind_all_listeners() primitive
    - create proto_tcp and move initialization of proxy listeners
    - stats: report numerical process ID, proxy ID and server ID
    - relative_pid was not initialized
    - missing header names in raw stats output
    - fix missing parenthesis in check_response_for_cacheability
    - small optimization on session_process_counters()
    - merge ebtree version 3.0
    - make ebtree headers multiple-include compatible
    - ebtree: include config.h for REGPRM*
    - differentiate between generic LB params and map-specific ones
    - add a weight divisor to the struct proxy
    - implement the Fast Weighted Round Robin (FWRR) algo
    - include filltab25.c to experiment on FWRR for dynamic weights
    - merge test-fwrr.cfg to validate dynamic weights
    - move the load balancing algorithm to be->lbprm.algo
    - change server check result to a bit field
    - implement "http-check disable-on-404" for graceful shutdown
    - secure the calling conditions of ->set_server_status_{up,down}
    - report disabled servers as "NOLB" when they are still UP
    - document the "http-check disable-on-404" option
    - http-check disable-on-404 is not limited to HTTP mode
    - add a test file for disable-on-404
    - use distinct bits per load-balancing algorithm type
    - implement the slowstart parameter for servers
    - document the server's slowstart parameter
    - stats: report the server warm up status in a "throttle" column
    - fix 2 minor issues on AIX
    - add the "nbsrv" ACL verb
    - add the "fail" condition to monitor requests
    - remove a warning from gcc due to htons() in standard.c
    - fwrr: ensure that we never overflow in placements
    - store the build options to report with -vv
    - fix the status return of the init script (R.I. Pienaar)
    - stats: real time monitoring script for unix socket (Prizee)
    - document "nbsrv" and "monitor fail"
    - restrict the set of allowed characters for identifiers
    - implement a time parsing function
    - add support for time units in the configuration
    - add a bit of documentation about timers
    - introduce separation between contimeout, and tarpit + queue
    - introduce the "timeout" keyword
    - grouped all timeouts in one structure
    - slowstart is in ms, not seconds
    - slowstart: ensure we don't start with a null weight
    - report the number of times each server was selected
    - fix build on AIX due to recent log changes
    - fix build on Solaris due to recent log changes

17 years ago[BUILD] fix build on Solaris due to recent log changes
Willy Tarreau [Wed, 5 Dec 2007 23:53:51 +0000 (00:53 +0100)] 
[BUILD] fix build on Solaris due to recent log changes

Solaris, as well as many other unixes doesn't know about sun_len
for UNIX domain sockets. It does not honnor the __SOCKADDR_COMMON
macro either. After looking at MacOS-X man (which is the same as
BSD man), OpenBSD man, and examples on the net, it appears that
those which support sun_len do not actually use it, or at least
ignore it as long as it's zero. Since all the sockaddr structures
are zeroed prior to being filled, it causes no problem not to set
sun_len, and this fixes build on other platforms.

Another problem on Solaris was that the "sun" name is already
defined as a macro returning a number, so it was necessary to
rename it.

17 years ago[BUILD] fix build on AIX due to recent log changes
Willy Tarreau [Wed, 5 Dec 2007 10:11:55 +0000 (11:11 +0100)] 
[BUILD] fix build on AIX due to recent log changes

17 years ago[MEDIUM] add support for logging via a UNIX socket
Robert Tsai [Wed, 5 Dec 2007 09:47:29 +0000 (10:47 +0100)] 
[MEDIUM] add support for logging via a UNIX socket

The code in haproxy-1.3.13.1 only supports syslogging to an internet
address. The attached patch:

 - Adds support for syslogging to a UNIX domain socket (e.g., /dev/log).
   If the address field begins with '/' (absolute file path), then
   AF_UNIX is used to construct the socket. Otherwise, AF_INET is used.

 - Achieves clean single-source build on both Mac OS X and Linux
   (sockaddr_in.sin_len and sockaddr_un.sun_len field aren't always present).

For handling sendto() failures in send_log(), it appears that the existing
code is fine (no need to close/recreate socket) for both UDP and UNIX-domain
syslog server. So I left things alone (did not close/recreate socket).
Closing/recreating socket after each failure would also work, but would lead
to increased amount of unnecessary socket creation/destruction if syslog is
temporarily unavailable for some reason (especially for verbose loggers).

Please consider this patch for inclusion into the upstream haproxy codebase.

17 years ago[STATS] report the number of times each server was selected
Willy Tarreau [Wed, 5 Dec 2007 09:34:49 +0000 (10:34 +0100)] 
[STATS] report the number of times each server was selected

One user reported that an indicator was missing in the statistics:
the number of times each server was selected by load balancing. It
is in fact the total number of sessions assigned to a server by the
load balancing algorithm. It should directly reflect the weight for
"fair" algorithms such as round-robin, since it will not account for
persistant connections.

It should help a lot tuning each server's weight depending on the
load it receives.

17 years ago[MEDIUM] slowstart: ensure we don't start with a null weight
Willy Tarreau [Mon, 3 Dec 2007 01:04:00 +0000 (02:04 +0100)] 
[MEDIUM] slowstart: ensure we don't start with a null weight

Because of a divide, it was possible to have a null weight during
a slowstart, which is pretty annoying, especially with a single
server and a long slowstart.

Also, fix the way we report the values in the stats page to avoid
confusion.

17 years ago[BUG] slowstart is in ms, not seconds
Willy Tarreau [Mon, 3 Dec 2007 00:51:45 +0000 (01:51 +0100)] 
[BUG] slowstart is in ms, not seconds

17 years ago[CLEANUP] grouped all timeouts in one structure
Willy Tarreau [Mon, 3 Dec 2007 00:38:36 +0000 (01:38 +0100)] 
[CLEANUP] grouped all timeouts in one structure

All known timeouts in a proxy have been grouped into a
"timeout" sub-structure.

17 years ago[MEDIUM] introduce the "timeout" keyword
Willy Tarreau [Mon, 3 Dec 2007 00:30:13 +0000 (01:30 +0100)] 
[MEDIUM] introduce the "timeout" keyword

A new "timeout" keyword replaces old "{con|cli|srv}timeout", and
provides the ability to independantly set the following timeouts :

  - client
  - tarpit
  - queue
  - connect
  - server
  - appsession

Additionally, the "clitimeout", "contimeout" and "srvtimeout" values
are supported but deprecated. No warning is emitted yet when they are
used since the option is very new.

Other timeouts should follow soon now.

17 years ago[MEDIUM] introduce separation between contimeout, and tarpit + queue
Willy Tarreau [Sun, 2 Dec 2007 23:36:16 +0000 (00:36 +0100)] 
[MEDIUM] introduce separation between contimeout, and tarpit + queue

Now the connect timeout, tarpit timeout and queue timeout are
distinct. In order to retain compatibility with older versions,
if either queue or tarpit is left unset both in the proxy and
in the default proxy, then it is inherited from the connect
timeout as before.

17 years ago[DOC] add a bit of documentation about timers
Willy Tarreau [Sun, 2 Dec 2007 21:27:38 +0000 (22:27 +0100)] 
[DOC] add a bit of documentation about timers

17 years ago[MEDIUM] add support for time units in the configuration
Willy Tarreau [Sun, 2 Dec 2007 21:15:14 +0000 (22:15 +0100)] 
[MEDIUM] add support for time units in the configuration

It is not always handy to manipulate large values exprimed
in milliseconds for timeouts. Also, some values are entered
in seconds (such as the stats refresh interval). This patch
adds support for time units. It knows about 'us', 'ms', 's',
'm', 'h', and 'd'. It automatically converts each value into
the caller's expected unit. Unit-less values are still passed
unchanged.

The unit must be passed as a suffix to the number. For instance:

     clitimeout 15m

If any character is not understood, an error is returned.

17 years ago[MINOR] implement a time parsing function
Willy Tarreau [Sun, 2 Dec 2007 21:00:35 +0000 (22:00 +0100)] 
[MINOR] implement a time parsing function

This new function accepts inputs in various default units, from
the microsecond to the day. It detects suffixes after numbers
and performs the appropriate conversions between the user's unit
and the program's unit, considering a unit-less number in the
default unit.

17 years ago[MEDIUM] restrict the set of allowed characters for identifiers
Willy Tarreau [Sun, 2 Dec 2007 17:45:09 +0000 (18:45 +0100)] 
[MEDIUM] restrict the set of allowed characters for identifiers

In order to avoid issues in the future, we want to restrict
the set of allowed characters for identifiers. Starting from
now, only A-Z, a-z, 0-9, '-', '_', '.' and ':' will be allowed
for a proxy, a server or an ACL name.

A test file has been added to check the restriction.

17 years ago[DOC] document "nbsrv" and "monitor fail"
Willy Tarreau [Sun, 2 Dec 2007 16:31:20 +0000 (17:31 +0100)] 
[DOC] document "nbsrv" and "monitor fail"

17 years ago[TESTS] stats: real time monitoring script for unix socket.
Willy Tarreau [Sun, 2 Dec 2007 13:11:36 +0000 (14:11 +0100)] 
[TESTS] stats: real time monitoring script for unix socket.

Julien Antony and Matthieu Huguet of Prizee provided this convenient
script to monitor activity via the unix socket. It requires presence
of the "socat" utility. Example of usage :

lb1:/home/scripts# ./stats_haproxy.sh -s prizee_media,FRONTEND
189 session/s (avg: 189 )       1040 concurrent sessions
182 session/s (avg: 185 )       1022 concurrent sessions
164 session/s (avg: 178 )       1015 concurrent sessions
175 session/s (avg: 177 )       1015 concurrent sessions
226 session/s (avg: 187 )       1031 concurrent sessions
252 session/s (avg: 198 )       1056 concurrent sessions
273 session/s (avg: 208 )       1072 concurrent sessions
268 session/s (avg: 216 )       1080 concurrent sessions
271 session/s (avg: 222 )       1131 concurrent sessions
241 session/s (avg: 224 )       1128 concurrent sessions
215 session/s (avg: 223 )       1136 concurrent sessions
206 session/s (avg: 221 )       1140 concurrent sessions

17 years ago[MINOR] fix the status return of the init script
Willy Tarreau [Sun, 2 Dec 2007 13:02:52 +0000 (14:02 +0100)] 
[MINOR] fix the status return of the init script

R.I. Pienaar reported to me that the init script provided with
haproxy did not correctly report the status of the rhstatus()
function. In fact this was caused by the "exit $RETVAL" instead
of "exit $?" at the end.

17 years ago[MINOR] store the build options to report with -vv
Willy Tarreau [Sun, 2 Dec 2007 10:28:59 +0000 (11:28 +0100)] 
[MINOR] store the build options to report with -vv

Sometimes it is useful to find out how a given binary version was
built. The build compiler and options are now provided for this,
and it's possible to get them with the -vv option.

17 years ago[CLEANUP] fwrr: ensure that we never overflow in placements
Willy Tarreau [Sun, 2 Dec 2007 10:01:23 +0000 (11:01 +0100)] 
[CLEANUP] fwrr: ensure that we never overflow in placements

Now we can compute the max place depending on the number of servers,
maximum weight and weight scale. The formula has been stored as a
comment so that it's easy to choose between smooth weight ramp up
and high number of servers. The default scale has been set to 16,
which permits 4000 servers with a granularity of 6% in the worst
case (weight=1).

17 years ago[CLEANUP] remove a warning from gcc due to htons() in standard.c
Willy Tarreau [Sun, 2 Dec 2007 09:55:56 +0000 (10:55 +0100)] 
[CLEANUP] remove a warning from gcc due to htons() in standard.c

Due to the fact that htons is defined as a macro, it's dangerous
to call it with auto-incremented arguments such as htons(f(++x)) :

src/standard.c: In function 'url2sa':
src/standard.c:291: warning: operation on 'curr' may be undefined

The solution is simply to store the intermediate result an pass it
to htons() at once.

17 years ago[MEDIUM] add the "fail" condition to monitor requests
Willy Tarreau [Fri, 30 Nov 2007 19:51:32 +0000 (20:51 +0100)] 
[MEDIUM] add the "fail" condition to monitor requests

Under certain circumstances, it is very useful to be able to fail some
monitor requests. One specific case is when the number of servers in
the backend falls below a certain level. The new "monitor fail" construct
followed by either "if"/"unless" <condition> makes it possible to specify
ACL-based conditions which will make the monitor return 503 instead of
200. Any number of conditions can be passed. Another use may be to limit
the requests to local networks only.

17 years ago[MEDIUM] add the "nbsrv" ACL verb
Willy Tarreau [Fri, 30 Nov 2007 19:48:53 +0000 (20:48 +0100)] 
[MEDIUM] add the "nbsrv" ACL verb

The new "nbsrv" ACL verb matches the number of active servers in a backend.
By default, it applies to the backend where it is declared, but optionally
it can receive the name of another backend as an argument in parenthesis.

It counts the number of enabled active servers first, then the number of
enabled backup servers.

17 years ago[BUILD] fix 2 minor issues on AIX
Willy Tarreau [Fri, 30 Nov 2007 17:38:35 +0000 (18:38 +0100)] 
[BUILD] fix 2 minor issues on AIX

AIX does not know about MSG_DONTWAIT. Fortunately, nearly all sockets
are already set to O_NONBLOCK, so it's not even required to change the
code.  It was only necessary to add this fcntl to the log socket which
lacked it.  The MSG_DONTWAIT value has been defined to zero when unset
in order to make the code cleaner and more portable.

Also, on AIX, "hz" is defined, which causes a problem with one function
parameter in time.c. It's enough to rename the parameter there. Last,
fix a missing #include <string.h> in proxy.c.

17 years ago[MINOR] stats: report the server warm up status in a "throttle" column
Willy Tarreau [Fri, 30 Nov 2007 17:16:29 +0000 (18:16 +0100)] 
[MINOR] stats: report the server warm up status in a "throttle" column

A new "throttle" column has been added to HTML and RAW stats to indicate
in percent, the level of throttling due to server warmup. The column is
empty at 100%.

17 years ago[DOC] document the server's slowstart parameter
Willy Tarreau [Fri, 30 Nov 2007 16:46:49 +0000 (17:46 +0100)] 
[DOC] document the server's slowstart parameter

17 years ago[MEDIUM] implement the slowstart parameter for servers
Willy Tarreau [Fri, 30 Nov 2007 16:42:05 +0000 (17:42 +0100)] 
[MEDIUM] implement the slowstart parameter for servers

The new 'slowstart' parameter for a server accepts a value in
milliseconds which indicates after how long a server which has
just come back up will run at full speed. The speed grows
linearly from 0 to 100% during this time. The limitation applies
to two parameters :

  - maxconn: the number of connections accepted by the server
    will grow from 1 to 100% of the usual dynamic limit defined
    by (minconn,maxconn,fullconn).

  - weight: when the backend uses a dynamic weighted algorithm,
    the weight grows linearly from 1 to 100%. In this case, the
    weight is updated at every health-check. For this reason, it
    is important that the 'inter' parameter is smaller than the
    'slowstart', in order to maximize the number of steps.

The slowstart never applies when haproxy starts, otherwise it
would cause trouble to running servers. It only applies when
a server has been previously seen as failed.

17 years ago[CLEANUP] use distinct bits per load-balancing algorithm type
Willy Tarreau [Fri, 30 Nov 2007 15:23:20 +0000 (16:23 +0100)] 
[CLEANUP] use distinct bits per load-balancing algorithm type

It's useful to be able to check against an LB algorithm type by
testing just one bit.

17 years ago[TESTS] add a test file for disable-on-404
Willy Tarreau [Fri, 30 Nov 2007 14:23:38 +0000 (15:23 +0100)] 
[TESTS] add a test file for disable-on-404

17 years ago[MINOR] http-check disable-on-404 is not limited to HTTP mode
Willy Tarreau [Fri, 30 Nov 2007 14:20:09 +0000 (15:20 +0100)] 
[MINOR] http-check disable-on-404 is not limited to HTTP mode

This option is for health-checks, do not limit it to HTTP proxies.

17 years ago[DOC] document the "http-check disable-on-404" option
Willy Tarreau [Fri, 30 Nov 2007 11:29:11 +0000 (12:29 +0100)] 
[DOC] document the "http-check disable-on-404" option

17 years ago[MEDIUM] report disabled servers as "NOLB" when they are still UP
Willy Tarreau [Fri, 30 Nov 2007 11:04:38 +0000 (12:04 +0100)] 
[MEDIUM] report disabled servers as "NOLB" when they are still UP

It's important to be able to distinguish between servers which are UP
and those which are UP but disabled via a 404 response. For this reason,
the status entries report "NOLB" instead of "UP", and the HTML page uses
darker colors. As a complement, write "DOWN" in bold red on the backend
if it has no server left for load balancing.

17 years ago[MEDIUM] secure the calling conditions of ->set_server_status_{up,down}
Willy Tarreau [Fri, 30 Nov 2007 10:11:02 +0000 (11:11 +0100)] 
[MEDIUM] secure the calling conditions of ->set_server_status_{up,down}

It's not always obvious for the callers of set_server_status_{up,down}
whether the new state really is up or down. Some flags as well as the
effective weight have to be considered. Let's ensure that those functions
perform the necessary check themselves so that if the state transition
cannot be performed, at least everything is updated as required.

17 years ago[MEDIUM] implement "http-check disable-on-404" for graceful shutdown
Willy Tarreau [Fri, 30 Nov 2007 09:41:39 +0000 (10:41 +0100)] 
[MEDIUM] implement "http-check disable-on-404" for graceful shutdown

When an HTTP server returns "404 not found", it indicates that at least
part of it is still running. For this reason, it can be convenient for
application administrators to be able to consider code 404 as valid,
but for a server which does not want to participate to load balancing
anymore. This is useful to seamlessly exclude a server from a farm
without acting on the load balancer. For instance, let's consider that
haproxy checks for the "/alive" file. To enable load balancing on a
server, the admin would simply do :

  # touch /var/www/alive

And to disable the server, he would simply do :

  # rm /var/www/alive

Another immediate gain from doing this is that it is now possible to
send NOTICE messages instead of ALERT messages when a server is first
disable, then goes down. This provides a graceful shutdown method.

To enable this behaviour, specify "http-check disable-on-404" in the
backend.

17 years ago[MEDIUM] change server check result to a bit field
Willy Tarreau [Fri, 30 Nov 2007 07:33:21 +0000 (08:33 +0100)] 
[MEDIUM] change server check result to a bit field

A server check currently returns either -1 or 1. This is not very
convenient to enhance the health-checks system. Let's use flags
instead.

17 years ago[MEDIUM] New option http_proxy
Alexandre Cassen [Thu, 29 Nov 2007 14:43:32 +0000 (15:43 +0100)] 
[MEDIUM] New option http_proxy

Hello,

You will find attached an updated release of previously submitted patch.
It polish some part and extend ACL engine to match IP and PORT parsed in
HTTP request. (and take care of comments made by Willy ! ;))

Best regards,
Alexandre

17 years ago[MINOR] move the load balancing algorithm to be->lbprm.algo
Willy Tarreau [Thu, 29 Nov 2007 14:38:04 +0000 (15:38 +0100)] 
[MINOR] move the load balancing algorithm to be->lbprm.algo

The number of possible options for a proxy has already reached
32, which is the current limit due to the fact that they are
each represented as a bit in a 32-bit word.

It's possible to move the load balancing algorithms to another
place. It will also save some space for future algorithms.

17 years ago[TESTS] merge test-fwrr.cfg to validate dynamic weights
Willy Tarreau [Mon, 26 Nov 2007 00:25:18 +0000 (01:25 +0100)] 
[TESTS] merge test-fwrr.cfg to validate dynamic weights

17 years ago[TESTS] include filltab25.c to experiment on FWRR for dynamic weights
Willy Tarreau [Mon, 26 Nov 2007 00:24:50 +0000 (01:24 +0100)] 
[TESTS] include filltab25.c to experiment on FWRR for dynamic weights

This is the 25th version of this test program. Merge it to ensure it
does not get lost.

17 years ago[MAJOR] implement the Fast Weighted Round Robin (FWRR) algo
Willy Tarreau [Mon, 26 Nov 2007 00:15:43 +0000 (01:15 +0100)] 
[MAJOR] implement the Fast Weighted Round Robin (FWRR) algo

This round robin algorithm was written from trees, so that we
do not have to recompute any table when changing server weights.
This solution allows on-the-fly weight adjustments with immediate
effect on the load distribution.

There is still a limitation due to 32-bit computations, to about
2000 servers at full scale (weight 255), or more servers with
lower weights. Basically, sum(srv.weight)*4096 must be below 2^31.

Test configurations and an example program used to develop the
tree will be added next.

Many changes have been brought to the weights computations and
variables in order to accomodate for the possiblity of a server to
be running but disabled from load balancing due to a null weight.

17 years ago[MINOR] add a weight divisor to the struct proxy
Willy Tarreau [Mon, 19 Nov 2007 18:10:18 +0000 (19:10 +0100)] 
[MINOR] add a weight divisor to the struct proxy

Under some circumstances, it will be useful to be able to have
a server's effective weight bigger than the user weight, and this
is particularly true for dynamic weight-based algorithms. In order
to support this, we add a "wdiv" member to the lbprm structure
which will always be used to divide the weights before reporting
them.

17 years ago[MEDIUM] differentiate between generic LB params and map-specific ones
Willy Tarreau [Thu, 15 Nov 2007 22:26:18 +0000 (23:26 +0100)] 
[MEDIUM] differentiate between generic LB params and map-specific ones

Since the introduction of server weights, all load balancing algorithms
relied on a pre-computed map. Incidently, quite a bunch of map-specific
parameters were used at random places in order to get the number of
servers or their total weight. It was not architecturally acceptable
that optimizations for the map computation had impact on external parts.
For instance, during this cleanup it was found that a backend weight was
seen as 1 when only the first backup server is used, whatever its weight.

This cleanup consists in differentiating between LB-generic parameters,
such as total weights, number of servers, etc... and map-specific ones.
The struct proxy has been enhanced in order to make it easier to later
support other algorithms. The recount_servers() function now also
updates generic values such as total weights so that it's not needed
anymore to call recalc_server_map() when weights are needed. This
permitted to simplify some code which does not need to know about map
internals anymore.

17 years ago[MEDIUM] ebtree: include config.h for REGPRM*
Willy Tarreau [Wed, 21 Nov 2007 09:34:15 +0000 (10:34 +0100)] 
[MEDIUM] ebtree: include config.h for REGPRM*

It's mandatory that all sources share the same defines for REGPRM*,
so let's include config.h for this.

17 years ago[BUILD] make ebtree headers multiple-include compatible
Willy Tarreau [Mon, 19 Nov 2007 17:43:04 +0000 (18:43 +0100)] 
[BUILD] make ebtree headers multiple-include compatible

ebtree did not support being included multiple times.

17 years ago[MINOR] merge ebtree version 3.0
Willy Tarreau [Thu, 15 Nov 2007 22:56:17 +0000 (23:56 +0100)] 
[MINOR] merge ebtree version 3.0

Version 3.0 of ebtree has been merged in but is not used yet.

17 years ago[OPTIM] small optimization on session_process_counters()
Willy Tarreau [Mon, 26 Nov 2007 19:15:35 +0000 (20:15 +0100)] 
[OPTIM] small optimization on session_process_counters()

It was possible to slightly reduce the size and the number of
operations in session_process_counters(). Two 64 bit comparisons
were removed, reducing the code by 98 bytes on x86 due to the lack
of registers. The net observed performance gain is almost 2%, which
cannot be attributed to those optimizations, but more likely to
induced changes in code alignment in other functions.

17 years ago[MEDIUM] continous statistics
Krzysztof Piotr Oledzki [Sat, 24 Nov 2007 21:12:47 +0000 (22:12 +0100)] 
[MEDIUM] continous statistics

By default, counters used for statistics calculation are incremented
only when a session finishes. It works quite well when serving small
objects, but with big ones (for example large images or archives) or
with A/V streaming, a graph generated from haproxy counters looks like
a hedgehog.

This patch implements a contstats (continous statistics) option.
When set counters get incremented continuously, during a whole session.
Recounting touches a hotpath directly so it is not enabled by default,
as it has small performance impact (~0.5%).

17 years ago[BUG] fix missing parenthesis in check_response_for_cacheability
Willy Tarreau [Sun, 25 Nov 2007 15:20:08 +0000 (16:20 +0100)] 
[BUG] fix missing parenthesis in check_response_for_cacheability

Parenthesis were missed when code was moved to this function.
This results in non-cacheable transactions not being ignored.

17 years ago[BUG] missing header names in raw stats output
Willy Tarreau [Mon, 26 Nov 2007 15:15:35 +0000 (16:15 +0100)] 
[BUG] missing header names in raw stats output

qlimit, pid, iid and sid were missing from the raw stats output

17 years ago[BUG] relative_pid was not initialized
Willy Tarreau [Mon, 26 Nov 2007 15:13:36 +0000 (16:13 +0100)] 
[BUG] relative_pid was not initialized

17 years ago[MINOR] stats: report numerical process ID, proxy ID and server ID
Willy Tarreau [Sun, 4 Nov 2007 22:35:08 +0000 (23:35 +0100)] 
[MINOR] stats: report numerical process ID, proxy ID and server ID

It is very convenient for SNMP monitoring to have unique process ID,
proxy ID and server ID. Those have been added to the CSV outputs.
The numbers start at 1. 0 is reserved. For servers, 0 means that the
reported name is not a server name but half a proxy (FRONTEND/BACKEND).

A remaining hidden "-" in the CSV output has been eliminated too.

17 years ago[MAJOR] create proto_tcp and move initialization of proxy listeners
Willy Tarreau [Mon, 29 Oct 2007 00:09:36 +0000 (01:09 +0100)] 
[MAJOR] create proto_tcp and move initialization of proxy listeners

Proxy listeners were very special and not very easy to manipulate.
A proto_tcp file has been created with all that is required to
manage TCPv4/TCPv6 as raw protocols, and provide generic listeners.

The code of start_proxies() and maintain_proxies() now looks less
like spaghetti. Also, event_accept will need a serious lifting in
order to use more of the information provided by the listener.

17 years ago[MINOR] add a generic unbind_all_listeners() primitive
Willy Tarreau [Sun, 28 Oct 2007 21:35:41 +0000 (22:35 +0100)] 
[MINOR] add a generic unbind_all_listeners() primitive

Most protocols will be able to share a single unbind_all_listeners()
primitive. Provide it in protocols.c.

17 years ago[MINOR] add a generic delete_listener() primitive
Willy Tarreau [Sun, 28 Oct 2007 21:26:05 +0000 (22:26 +0100)] 
[MINOR] add a generic delete_listener() primitive

Most protocols will be able to share a single delete_listener()
primitive. Provide it in protocols.c, and remove the specific
version from proto_uxst.

17 years ago[MINOR] add a generic unbind_listener() primitive
Willy Tarreau [Sun, 28 Oct 2007 21:13:50 +0000 (22:13 +0100)] 
[MINOR] add a generic unbind_listener() primitive

Most protocols will be able to share a single unbind_listener()
primitive. Provided it in protocols.c.

17 years ago[MEDIUM] unbind_listener() must use fd_delete() and not close()
Willy Tarreau [Sun, 28 Oct 2007 21:07:08 +0000 (22:07 +0100)] 
[MEDIUM] unbind_listener() must use fd_delete() and not close()

It is important that unbind_listener() calls fd_delete() to remove
a file descriptor, because only this one can update the fdtab and
the maxfd entries.

17 years ago[MAJOR] added a new state to listeners
Willy Tarreau [Sun, 28 Oct 2007 20:59:24 +0000 (21:59 +0100)] 
[MAJOR] added a new state to listeners

There was a missing state for listeners, when they are not listening
but still attached to the protocol. The LI_ASSIGNED state was added
for this purpose. This permitted to clean up the assignment/release
workflow quite a bit. Generic enable/enable_all/disable/disable_all
primitives were added, and a disable_all entry was added to the
struct protocol.

17 years ago[MINOR] add an options field to the listeners
Willy Tarreau [Sun, 28 Oct 2007 16:02:33 +0000 (17:02 +0100)] 
[MINOR] add an options field to the listeners

17 years ago[MEDIUM] simplify error path in event_accept()
Willy Tarreau [Sun, 4 Nov 2007 16:51:50 +0000 (17:51 +0100)] 
[MEDIUM] simplify error path in event_accept()

The error path in event_accept() was complicated by many code
duplications. Use the classical unrolling with the gotos. This
fix alone reduced the code by 2.5 kB.

17 years ago[MINOR] avoid calling some layer7 functions if not needed
Willy Tarreau [Sun, 4 Nov 2007 18:30:00 +0000 (19:30 +0100)] 
[MINOR] avoid calling some layer7 functions if not needed

Small optimization: in some cases, it's not interesting to call
functions which are dedicated to checking the cache headers or
cookies. Avoid calling them when not necessary.

17 years ago[MINOR] adjust error messages about conflicting proxies
Willy Tarreau [Sun, 4 Nov 2007 06:04:43 +0000 (07:04 +0100)] 
[MINOR] adjust error messages about conflicting proxies

It's not easy to report useful information to help the user quickly
fix a configuration. This patch :
  - removes the word "listener" in favor of "proxy" as it has been
    used since the beginning ;

  - ensures that the same function (hence the same words) will be
    used to report capabilities of a proxy being declared and an
    existing proxy ;

  - avoid the term "conflicting capabilities" in favor of "overlapping
    capabilities" which is more exact.

  - just report that the same name is reused in case of warnings

17 years ago[MEDIUM] Implement and use generic findproxy and relax duplicated proxy check
Krzysztof Piotr Oledzki [Sat, 3 Nov 2007 22:41:58 +0000 (23:41 +0100)] 
[MEDIUM] Implement and use generic findproxy and relax duplicated proxy check

This patch:
 - adds proxy_mode_str() similar to proxy_type_str()
 - adds a generic findproxy function used with default_backend/setbe/use_backed
 - rewrite default_backend/senbe/use_backed to use introduced findproxy()
 - relaxes duplicated proxy check
 - changes capabilities displaying from "%X" to "%s" with a call to proxy_type_str()

17 years ago[BUILD] disable warning about localtime_r on Solaris
Willy Tarreau [Sat, 3 Nov 2007 15:18:11 +0000 (16:18 +0100)] 
[BUILD] disable warning about localtime_r on Solaris

Solaris only declares localtime_r() if _REENTRANT is defined. Update
the makefile to silent the warning.

17 years ago[MEDIUM] make default_backend work in TCP mode too
Willy Tarreau [Sat, 3 Nov 2007 13:28:39 +0000 (14:28 +0100)] 
[MEDIUM] make default_backend work in TCP mode too

The default_backend did not work in TCP mode since there was no
header state to assign the backend. This causes much trouble when
configs are created by copy-paste.

The solution was to fix the way the backend is assigned upon accept().
A wrong contimeout assignment was fixed too.

17 years ago[MEDIUM] introduce the "url_param" balance method
Willy Tarreau [Thu, 1 Nov 2007 21:48:15 +0000 (22:48 +0100)] 
[MEDIUM] introduce the "url_param" balance method

Some applications do not have a strict persistence requirement, yet
it is still desirable for performance considerations, due to local
caches on the servers. For some reasons, there are some applications
which cannot rely on cookies, and for which the last resort is to use
a parameter passed in the URL.

The new 'url_param' balance method is there to solve this issue. It
accepts a parameter name which is looked up from the URL and which
is then hashed to select a server. If the parameter is not found,
then the round robin algorithm is used in order to provide a normal
load balancing across the servers for the first requests. It would
have been possible to use a source IP hash instead, but since such
applications are generally buried behind multiple levels of
reverse-proxies, it would not provide a good balance.

The doc has been updated, and two regression testing configurations
have been added.

17 years ago[MINOR] externalize the "balance" option parser to backend.c
Willy Tarreau [Thu, 1 Nov 2007 20:39:54 +0000 (21:39 +0100)] 
[MINOR] externalize the "balance" option parser to backend.c

A new function "backend_parse_balance" has been created in backend.c,
which is dedicated to the parsing of the "balance" keyword. It will
provide easier methods for adding new algorithms.

17 years ago[CLEANUP] group PR_O_BALANCE_* bits into a checkable value
Willy Tarreau [Thu, 1 Nov 2007 20:08:19 +0000 (21:08 +0100)] 
[CLEANUP] group PR_O_BALANCE_* bits into a checkable value

In preparation for newer balance algorithms, group the
sparse PR_O_BALANCE_* values into layer4 and layer7-based
algorithms. This will ease addition of newer algorithms.

17 years ago[MEDIUM] Handle long lines properly
Krzysztof Piotr Oledzki [Wed, 31 Oct 2007 23:33:12 +0000 (00:33 +0100)] 
[MEDIUM] Handle long lines properly

Currently, there is a hidden line length limit in the haproxy, set
to 256-1 chars. With large acls (for example many hdr(host) matches)
it may be not enough and which is even worse, error message may
be totally confusing as everything above this limit is treated
as a next line:

echo -ne "frontend aqq 1.2.3.4:80\nmode http\nacl e hdr(host) -i X X X X X X X www.xx.example.com stats\n"|
 sed s/X/www.some-host-name.example.com/g > ha.cfg && haproxy -c -f ./ha.cfg

[WARNING] 300/163906 (11342) : parsing [./ha.cfg:4] : 'stats' ignored because frontend 'aqq' has no backend capability.

Recently I hit simmilar problem and it took me a while to find why
requests for "stats" are not handled properly.

This patch:
 - makes the limit configurable (LINESIZE)
 - increases default line length limit from 256 to 2048
 - increases MAX_LINE_ARGS from 40 to 64
 - fixes hidden assignment in fgets()
 - moves arg/end/args/line inside the loop, making code auditing easier
 - adds a check that shows error if the limit is reached
 - changes "*line++ = 0;" to "*line++ = '\0';" (cosmetics)

With this patch, when LINESIZE is defined to 256, above example produces:
[ALERT] 300/164724 (27364) : parsing [/tmp/ha.cfg:3]: line too long, limit: 255.
[ALERT] 300/164724 (27364) : Error reading configuration file : /tmp/ha.cfg

17 years ago[PATCH] use backends only with use_backend directive
Krzysztof Oledzki [Wed, 31 Oct 2007 08:07:24 +0000 (09:07 +0100)] 
[PATCH] use backends only with use_backend directive

Hello,

As it is possible to use the same name for two proxies, make sure that
use_backed & friends does not match wrong proxy when used with use_backend/
default_backend/setbe. For example, without this patch, when there is a
backend and frontend with the same name (first backend and then frontend
trying to use specific backend), the application will likely try to use
frontend instead of backend, complaining loudly about a loop.

Best regards,

                                 Krzysztof Oledzki

17 years ago[MINOR] add socket address length to the protocols
Willy Tarreau [Sun, 28 Oct 2007 11:09:45 +0000 (12:09 +0100)] 
[MINOR] add socket address length to the protocols

The protocol struct can be more useful if it also provides
address lengths. Add sock_addrlen, as used by bind(), as
well as l3_addrlen for hashes.

17 years ago[CLEANUP] silent warning about LIST_* being redefined on OpenBSD
Willy Tarreau [Sun, 28 Oct 2007 10:41:06 +0000 (11:41 +0100)] 
[CLEANUP] silent warning about LIST_* being redefined on OpenBSD

Building ev_kqueue on OpenBSD causes some warnings to occur,
because OpenBSD also uses LIST_* macros in sys/queue.h, included
from sys/event.h. Simply undefine those macros since we don't
need them.

17 years ago[MINOR] move error codes to common/errors.h
Willy Tarreau [Sun, 28 Oct 2007 10:14:07 +0000 (11:14 +0100)] 
[MINOR] move error codes to common/errors.h

It's useful to be able to share error codes between C files,
so move the codes currently only used in protocols to a generic
file.

17 years ago[TESTS] add a simple test for the status page
Willy Tarreau [Thu, 25 Oct 2007 18:17:40 +0000 (20:17 +0200)] 
[TESTS] add a simple test for the status page