]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
15 years ago[MEDIUM] add ability to connect to a server from an IP found in a header
Willy Tarreau [Mon, 7 Sep 2009 09:51:47 +0000 (11:51 +0200)] 
[MEDIUM] add ability to connect to a server from an IP found in a header

Using get_ip_from_hdr2() we can look for occurrence #X or #-X and
extract the IP it contains. This is typically designed for use with
the X-Forwarded-For header.

Using "usesrc hdr_ip(name,occ)", it becomes possible to use the IP address
found in <name>, and possibly specify occurrence number <occ>, as the
source to connect to a server. This is possible both in a server and in
a backend's source statement. This is typically used to use the source
IP previously set by a upstream proxy.

15 years ago[MINOR] add new tproxy flags for dynamic source address binding
Willy Tarreau [Mon, 7 Sep 2009 09:51:47 +0000 (11:51 +0200)] 
[MINOR] add new tproxy flags for dynamic source address binding

This patch adds a new TPROXY bind type, TPROXY_DYN, to indicate to the
TCP connect function that we want to bind to the address passed in
argument.

15 years ago[MINOR] add very fast IP parsing functions
Willy Tarreau [Mon, 7 Sep 2009 09:00:31 +0000 (11:00 +0200)] 
[MINOR] add very fast IP parsing functions

Those functions were previouly used in my firewall log parser,
and are particularly suited for use with http headers.

15 years ago[MEDIUM] backend: move the transparent proxy address selection to backend
Willy Tarreau [Mon, 29 Mar 2010 17:36:59 +0000 (19:36 +0200)] 
[MEDIUM] backend: move the transparent proxy address selection to backend

The transparent proxy address selection was set in the TCP connect function
which is not the most appropriate place since this function has limited
access to the amount of parameters which could produce a source address.

Instead, now we determine the source address in backend.c:connect_server(),
right after calling assign_server_address() and we assign this address in
the session and pass it to the TCP connect function. This cannot be performed
in assign_server_address() itself because in some cases (transparent mode,
dispatch mode or http_proxy mode), we assign the address somewhere else.

This change will open the ability to bind to addresses extracted from many
other criteria (eg: from a header).

15 years ago[CLEANUP] proxy: move PR_O_SSL3_CHK to options2 to release one flag
Willy Tarreau [Mon, 29 Mar 2010 16:33:29 +0000 (18:33 +0200)] 
[CLEANUP] proxy: move PR_O_SSL3_CHK to options2 to release one flag

We'll need another flag in the 'options' member close to PR_O_TPXY_*,
and all are used, so let's move this easy one to options2 (which are
already used for SQL checks).

15 years ago[RELEASE] Released version 1.4.3 v1.4.3
Willy Tarreau [Tue, 30 Mar 2010 07:50:08 +0000 (09:50 +0200)] 
[RELEASE] Released version 1.4.3

Released version 1.4.3 with the following main changes :
    - [CLEANUP] stats: remove printf format warning in stats_dump_full_sess_to_buffer()
    - [MEDIUM] session: better fix for connection to servers with closed input
    - [DOC] indicate in the doc how to bind to port ranges
    - [BUG] backend: L7 hashing must not be performed on incomplete requests
    - [TESTS] add a simple program to test connection resets
    - [MINOR] cli: "show errors" should display "backend <NONE>" when backend was not used
    - [MINOR] config: emit warnings when HTTP-only options are used in TCP mode
    - [MINOR] config: allow "slowstart 0s"
    - [BUILD] 'make tags' did not consider files ending in '.c'
    - [MINOR] checks: add the ability to disable a server in the config

15 years ago[MINOR] checks: add the ability to disable a server in the config
Willy Tarreau [Mon, 29 Mar 2010 08:02:24 +0000 (10:02 +0200)] 
[MINOR] checks: add the ability to disable a server in the config

Adding the "disabled" keyword on a server line disables it. It can
then be enabled again on the unix socket.

15 years ago[BUILD] 'make tags' did not consider files ending in '.c'
Willy Tarreau [Mon, 29 Mar 2010 07:35:20 +0000 (09:35 +0200)] 
[BUILD] 'make tags' did not consider files ending in '.c'

A missing parenthesis made the output of find apply only to files
'.h' making the tags useless.

15 years ago[MINOR] config: allow "slowstart 0s"
Willy Tarreau [Fri, 26 Mar 2010 09:40:49 +0000 (10:40 +0100)] 
[MINOR] config: allow "slowstart 0s"

Sometimes it's useful to be able to disable slowstart by setting "slowstart 0".

15 years ago[MINOR] config: emit warnings when HTTP-only options are used in TCP mode
Willy Tarreau [Thu, 25 Mar 2010 06:22:56 +0000 (07:22 +0100)] 
[MINOR] config: emit warnings when HTTP-only options are used in TCP mode

It's very common to see people getting trapped by HTTP-only options
which don't work in TCP proxies. To help them definitely get rid of
those configs, let's emit warnings for all options and statements
which are not supported in their mode. That includes all HTTP-only
options, the cookies and the stats.

In order to ensure internal config correctness, the options are also
disabled.

15 years ago[MINOR] cli: "show errors" should display "backend <NONE>" when backend was not used
Willy Tarreau [Thu, 25 Mar 2010 05:45:07 +0000 (06:45 +0100)] 
[MINOR] cli: "show errors" should display "backend <NONE>" when backend was not used

It was disturbing to see a backend name associated with a bad request
when this "backend" was in fact the frontend. Instead, we now display
"backend <NONE>" if the "backend" has no backend capability :

> show errors

[25/Mar/2010:06:44:25.394] frontend fe (#1): invalid request
  src 127.0.0.1, session #0, backend <NONE> (#-1), server <NONE> (#-1)
  request length 45 bytes, error at position 0:

15 years ago[TESTS] add a simple program to test connection resets
Willy Tarreau [Wed, 24 Mar 2010 17:43:56 +0000 (18:43 +0100)] 
[TESTS] add a simple program to test connection resets

The "reset" program may be used to send strings then reset connections.

15 years ago[BUG] backend: L7 hashing must not be performed on incomplete requests
Willy Tarreau [Wed, 24 Mar 2010 13:54:30 +0000 (14:54 +0100)] 
[BUG] backend: L7 hashing must not be performed on incomplete requests

Isidore Li reported an occasional segfault when using URL hashing, and
kindly provided backtraces and core files to help debugging.

The problem was triggered by reset connections before the URL was sent,
and was due to the same bug which was fixed by commit e45997661bf
(connections were attempted in case of connection abort). While that
bug was already fixed, it appeared that the same segfault could be
triggered when URL hashing is configured in an HTTP backend when the
frontend runs in TCP mode and no URL was seen. It is totally abnormal
to try to hash a null URL, as well as to process any kind of L7 hashing
when a full request was not seen.

This additional fix now ensures that layer7 hashing is not performed on
incomplete requests.

15 years ago[DOC] indicate in the doc how to bind to port ranges
Willy Tarreau [Mon, 22 Mar 2010 10:53:56 +0000 (11:53 +0100)] 
[DOC] indicate in the doc how to bind to port ranges

This part was missing from the new doc.

15 years ago[MEDIUM] session: better fix for connection to servers with closed input
Willy Tarreau [Sun, 21 Mar 2010 22:25:09 +0000 (23:25 +0100)] 
[MEDIUM] session: better fix for connection to servers with closed input

The following patch fixed an issue but brought another one :
  296897 [MEDIUM] connect to servers even when the input has already been closed

The new issue is that when a connection is inspected and aborted using
TCP inspect rules, now it is sent to the server before being closed. So
that test is not satisfying. A probably better way is not to prevent a
connection from establishing if only BF_SHUTW_NOW is set but BF_SHUTW
is not. That way, the BF_SHUTW flag is not set if the request has any
data pending, which still fixes the stats issue, but does not let any
empty connection pass through.

Also, as a safety measure, we extend buffer_abort() to automatically
disable the BF_AUTO_CONNECT flag. While it appears to always be OK,
it is by pure luck, so better safe than sorry.

15 years ago[CLEANUP] stats: remove printf format warning in stats_dump_full_sess_to_buffer()
Willy Tarreau [Sun, 21 Mar 2010 22:21:00 +0000 (23:21 +0100)] 
[CLEANUP] stats: remove printf format warning in stats_dump_full_sess_to_buffer()

This warning was first reported by Ross West on FreeBSD, then by
Holger Just on OpenSolaris. It also happens on 64bit Linux. However,
fixing the format to use long int complains on 32bit Linux where
ptrdiff_t is apparently different. Better cast the pointer difference
to an int then.

15 years ago[RELEASE] Released version 1.4.2 v1.4.2
Willy Tarreau [Wed, 17 Mar 2010 22:41:57 +0000 (23:41 +0100)] 
[RELEASE] Released version 1.4.2

Released version 1.4.2 with the following main changes :
    - [CLEANUP] product branch update
    - [DOC] Some more documentation cleanups
    - [BUG] clf logs segfault when capturing a non existant header
    - [OPTIM] config: only allocate check buffer when checks are enabled
    - [MEDIUM] checks: support multi-packet health check responses
    - [CLEANUP] session: remove duplicate test
    - [BUG] http: don't wait for response data to leave buffer is client has left
    - [MINOR] proto_uxst: set accept_date upon accept() to the wall clock time
    - [MINOR] stats: don't send empty lines in "show errors"
    - [MINOR] stats: make the data dump function reusable for other purposes
    - [MINOR] stats socket: add show sess <id> to dump details about a session
    - [BUG] stats: connection reset counters must be plain ascii, not HTML
    - [BUG] url_param hash may return a down server
    - [MINOR] force null-termination of hostname
    - [MEDIUM] connect to servers even when the input has already been closed
    - [BUG] don't merge anonymous ACLs !
    - [BUG] config: fix endless loop when parsing "on-error"
    - [MINOR] http: don't mark a server as failed when it returns 501/505
    - [OPTIM] checks: try to detect the end of response without polling again
    - [BUG] checks: don't report an error when recv() returns an error after data
    - [BUG] checks: don't abort when second poll returns an error
    - [MINOR] checks: make shutdown() silently fail
    - [BUG] http: fix truncated responses on chunk encoding when size divides buffer size
    - [BUG] init: unconditionally catch SIGPIPE
    - [BUG] checks: don't wait for a close to start parsing the response

15 years ago[OPTIM] config: only allocate check buffer when checks are enabled
Cyril Bonté [Wed, 17 Mar 2010 17:56:31 +0000 (18:56 +0100)] 
[OPTIM] config: only allocate check buffer when checks are enabled

To save a little memory, the check_data buffer is only allocated
for the servers that are checked.

[WT: this patch saves 80 MB of RAM on the test config with 5000 servers]

15 years ago[BUG] checks: don't wait for a close to start parsing the response
Willy Tarreau [Wed, 17 Mar 2010 20:52:07 +0000 (21:52 +0100)] 
[BUG] checks: don't wait for a close to start parsing the response

Cyril Bonté reported a regression introduced with very last changes
on the checks code, which causes failed checks on if the server does
not close the connection in time. This happens on HTTP/1.1 checks or
on SMTP checks for instance.

This fix consists in restoring the old behaviour of parsing as soon
as something is available in the response buffer, and waiting for
more data if some are missing. This also helps releasing connections
earlier (eg: a GET check will not have to download the whole object).

15 years ago[BUG] init: unconditionally catch SIGPIPE
Willy Tarreau [Wed, 17 Mar 2010 17:02:46 +0000 (18:02 +0100)] 
[BUG] init: unconditionally catch SIGPIPE

Apparently some systems define MSG_NOSIGNAL but do not necessarily
check it (or maybe binaries are built somewhere and used on older
versions). There were reports of very recent FreeBSD setups causing
SIGPIPEs, while older ones catch the signal. Recent FreeBSD manpages
indeed define MSG_NOSIGNAL.

So let's now unconditionnaly catch the signal. It's useless not to do
it for the rare cases where it's not needed (linux 2.4 and below).

15 years ago[BUG] http: fix truncated responses on chunk encoding when size divides buffer size
Willy Tarreau [Wed, 17 Mar 2010 14:54:24 +0000 (15:54 +0100)] 
[BUG] http: fix truncated responses on chunk encoding when size divides buffer size

Bernhard Krieger reported truncated HTTP responses in presence of some
specific chunk-encoded data, and kindly offered complete traces of the
issue which made it easy to reproduce it.

Those traces showed that the chunks were of exactly 8192 bytes, chunk
size and CRLF included, which was exactly half the size of the buffer.
In this situation, the function http_chunk_skip_crlf() could erroneously
try to parse a CRLF after the chunk believing there were more data
pending, because the number of bytes present in the buffer was considered
instead of the number of remaining bytes to be parsed.

15 years ago[MINOR] checks: make shutdown() silently fail
Willy Tarreau [Tue, 16 Mar 2010 19:57:57 +0000 (20:57 +0100)] 
[MINOR] checks: make shutdown() silently fail

Shutdown may fail for instance after an RST. So we must not report
any error for that.

15 years ago[BUG] checks: don't abort when second poll returns an error
Willy Tarreau [Tue, 16 Mar 2010 20:14:41 +0000 (21:14 +0100)] 
[BUG] checks: don't abort when second poll returns an error

Now that the response may be fragmented, we may receive early notifications
of aborts in return of poll(), as indicated below, which currently cause
an early error detection :

  21:11:21.036600 epoll_wait(3, {{EPOLLIN, {u32=7, u64=7}}}, 8, 993) = 1
  21:11:21.054361 gettimeofday({1268770281, 54467}, NULL) = 0
  21:11:21.054540 recv(7, "H"..., 8030, 0) = 1
  21:11:21.054694 recv(7, 0x967e759, 8029, 0) = -1 EAGAIN (Resource temporarily unavailable)
  21:11:21.054843 epoll_wait(3, {{EPOLLIN|EPOLLERR|EPOLLHUP, {u32=7, u64=7}}}, 8, 975) = 1
  21:11:21.060274 gettimeofday({1268770281, 60386}, NULL) = 0
  21:11:21.060454 close(7)                = 0

Just as in stream_sock, we must not believe poll() without attempting to receive,
which fixes the issue :

  21:11:59.402207 recv(7, "H"..., 8030, 0) = 1
  21:11:59.402362 recv(7, 0x8b5c759, 8029, 0) = -1 EAGAIN (Resource temporarily unavailable)
  21:11:59.402511 epoll_wait(3, {{EPOLLIN|EPOLLERR|EPOLLHUP, {u32=7, u64=7}}}, 8, 974) = 1
  21:11:59.407242 gettimeofday({1268770319, 407353}, NULL) = 0
  21:11:59.407425 recv(7, "TTP/1.0 200 OK\r\n"..., 8029, 0) = 16
  21:11:59.407606 recv(7, 0x8b5c769, 8013, 0) = -1 ECONNRESET (Connection reset by peer)
  21:11:59.407753 shutdown(7, 2 /* send and receive */) = -1 ENOTCONN (Transport endpoint is not connected)

15 years ago[BUG] checks: don't report an error when recv() returns an error after data
Willy Tarreau [Tue, 16 Mar 2010 19:55:43 +0000 (20:55 +0100)] 
[BUG] checks: don't report an error when recv() returns an error after data

This happens when a server immediately closes the connection after
the response without lingering or when we close before the end of
the data. We get an RST which translates into a late error. We must
not declare an error without checking that the contents are OK.

15 years ago[OPTIM] checks: try to detect the end of response without polling again
Willy Tarreau [Tue, 16 Mar 2010 19:32:04 +0000 (20:32 +0100)] 
[OPTIM] checks: try to detect the end of response without polling again

Since the recv() call returns every time it succeeds, we always need
to calls with one intermediate poll before detecting the end of response :

  20:20:03.958207 recv(7, "HTTP/1.1 200\r\nConnection: close\r\n"..., 8030, 0) = 145
  20:20:03.958365 epoll_wait(3, {{EPOLLIN, {u32=7, u64=7}}}, 8, 1000) = 1
  20:20:03.958543 gettimeofday({1268767203, 958626}, NULL) = 0
  20:20:03.958694 recv(7, ""..., 7885, 0) = 0
  20:20:03.958833 shutdown(7, 2 /* send and receive */) = 0

Let's read as long as we can, that way we can detect end of connections
in the same call, which is much more efficient especially for LBs with
hundreds of servers :

  20:29:58.797019 recv(7, "HTTP/1.1 200\r\nConnection: close\r\n"..., 8030, 0) = 145
  20:29:58.797182 recv(7, ""..., 7885, 0) = 0
  20:29:58.797356 shutdown(7, 2 /* send and receive */) = 0

15 years ago[MEDIUM] checks: support multi-packet health check responses
Nick Chalk [Tue, 16 Mar 2010 15:50:46 +0000 (15:50 +0000)] 
[MEDIUM] checks: support multi-packet health check responses

We are seeing both real servers repeatedly going on- and off-line with
a period of tens of seconds. Packet tracing, stracing, and adding
debug code to HAProxy itself has revealed that the real servers are
always responding correctly, but HAProxy is sometimes receiving only
part of the response.

It appears that the real servers are sending the test page as three
separate packets. HAProxy receives the contents of one, two, or three
packets, apparently randomly. Naturally, the health check only
succeeds when all three packets' data are seen by HAProxy. If HAProxy
and the real servers are modified to use a plain HTML page for the
health check, the response is in the form of a single packet and the
checks do not fail.

(...)
I've added buffer and length variables to struct server, and allocated
space with the rest of the server initialisation.

(...)
It seems to be working fine in my tests, and handles check responses
that are bigger than the buffer.

15 years ago[MINOR] http: don't mark a server as failed when it returns 501/505
Willy Tarreau [Mon, 15 Mar 2010 18:44:39 +0000 (19:44 +0100)] 
[MINOR] http: don't mark a server as failed when it returns 501/505

Those two codes can be triggered on demand by client requests.
We must not fail a server on them.

Ideally we should ignore a certain amount of status codes which do
not indicate life nor death.

15 years ago[BUG] config: fix endless loop when parsing "on-error"
Willy Tarreau [Mon, 15 Mar 2010 18:40:37 +0000 (19:40 +0100)] 
[BUG] config: fix endless loop when parsing "on-error"

An arg index increment was missing causing the same arg to be parsed
in an endless loop. Proabably a merge conflict that remained undetected.

15 years ago[BUG] don't merge anonymous ACLs !
Willy Tarreau [Mon, 15 Mar 2010 15:13:29 +0000 (16:13 +0100)] 
[BUG] don't merge anonymous ACLs !

The new anonymous ACL feature was buggy. If several ones are
declared, the first rule is always matched because all of them
share the same internal name (".noname"). Now we simply declare
them with an empty name and ensure that we disable any merging
when the name is empty.

15 years ago[BUG] clf logs segfault when capturing a non existant header
Cyril Bonté [Sat, 13 Mar 2010 14:15:07 +0000 (15:15 +0100)] 
[BUG] clf logs segfault when capturing a non existant header

Hi Willy,

Please find a small patch to prevent haproxy segfaulting when logging captured headers in CLF format.

Example config to reproduce the bug :
listen test :10080
log 127.0.0.1 local7 debug err
mode http
option httplog clf
capture request header NonExistantHeader len 16

--
Cyril Bonté

15 years ago[MEDIUM] connect to servers even when the input has already been closed
Willy Tarreau [Sun, 14 Mar 2010 18:21:34 +0000 (19:21 +0100)] 
[MEDIUM] connect to servers even when the input has already been closed

The BF_AUTO_CLOSE flag prevented a connection from establishing on
a server if the other side's input channel was already closed. This
is wrong because there may be pending data to be sent.

This was causing an issue with stats, as noticed and reported by
Cyril Bonté. Since the stats are now handled as a server, sometimes
concurrent accesses were causing one of the connections to send the
shutdown(write) before the connection to the stats function was
established, which aborted it early.

This fix causes the BF_AUTO_CLOSE flag to be checked only when the
connection on the outgoing stream interface has reached an established
state. That way we're still able to connect, send the request then
close.

15 years ago[MINOR] force null-termination of hostname
Willy Tarreau [Fri, 12 Mar 2010 20:58:54 +0000 (21:58 +0100)] 
[MINOR] force null-termination of hostname

Marcello Gorlani reported that at least on FreeBSD, a long hostname
was reported with garbage on the stats page. POSIX does not make it
mandatory for gethostname() to NULL-terminate the string in case of
truncation, and at least FreeBSD appears not to do it. So let's
force null-termination to keep safe.

15 years ago[DOC] Some more documentation cleanups
Cyril Bonté [Wed, 10 Mar 2010 21:41:43 +0000 (22:41 +0100)] 
[DOC] Some more documentation cleanups

Since the last documentation cleanups, I've found more typos that I kept
in a corner instead of sending you a mail just for one character :)

--
Cyril Bonté

15 years ago[CLEANUP] product branch update
Cyril Bonté [Wed, 10 Mar 2010 21:41:43 +0000 (22:41 +0100)] 
[CLEANUP] product branch update

today I've noticed that the stats page still displays v1.3 in the
"Updates" link, due to the PRODUCT_BRANCH value in version.h, then
it's maybe time to send you the result (notice that the patch updates
PRODUCT_BRANCH to "1.4").

--
Cyril Bonté

15 years ago[BUG] url_param hash may return a down server
Willy Tarreau [Fri, 12 Mar 2010 05:22:16 +0000 (06:22 +0100)] 
[BUG] url_param hash may return a down server

Jozef Hovan reported a bug sometimes causing a down server to be
used in url_param hashing mode.

This happens if the following conditions are met :
  - the backend contains more than one server with at least two
    of different weights
  - all servers but one are down
  - the server which is not down has a weight which does not divide
    all the other ones

Example: 3 servers with 20,20,10, the first one remains up.

The problem is caused by an optimisation in recalc_server_map()
which only fills the first map slot when only one server is up,
because all LB algorithms are optimized to use entry zero when
only one server is up... All but url_param. When doing the modulus,
we can return a position which is greater than zero and use an
entry which still refers to a server which has since been stopped.

One solution could be to optimize the url_param algo to proceed
as the other ones, but the fact that was wrong implies that we
can repeat the same bug later. So let's first correctly initialize
the map in order to avoid that trap.

15 years ago[BUG] stats: connection reset counters must be plain ascii, not HTML
Willy Tarreau [Fri, 5 Mar 2010 17:15:23 +0000 (18:15 +0100)] 
[BUG] stats: connection reset counters must be plain ascii, not HTML

Using U2H*() to put numbers in title tags is a bad idea as those
appear in the HTML itself. Problem reported by Laurent Dolosor.

15 years ago[MINOR] stats socket: add show sess <id> to dump details about a session
Willy Tarreau [Fri, 5 Mar 2010 16:53:32 +0000 (17:53 +0100)] 
[MINOR] stats socket: add show sess <id> to dump details about a session

When trying to spot some complex bugs, it's often needed to access
information on stuck sessions, which is quite difficult. This new
command helps one get detailed information about a session, with
flags, timers, states, etc... The buffer data are not dumped yet.

15 years ago[MINOR] stats: make the data dump function reusable for other purposes
Willy Tarreau [Fri, 5 Mar 2010 13:58:26 +0000 (14:58 +0100)] 
[MINOR] stats: make the data dump function reusable for other purposes

The dump_error_line() function was limited to dump error buffers while
it's perfectly suitable to dump anything else.

15 years ago[MINOR] stats: don't send empty lines in "show errors"
Willy Tarreau [Fri, 5 Mar 2010 16:42:58 +0000 (17:42 +0100)] 
[MINOR] stats: don't send empty lines in "show errors"

Empty lines indicate end of dump, so it's important not to do that.
Send a single space instead.

15 years ago[MINOR] proto_uxst: set accept_date upon accept() to the wall clock time
Willy Tarreau [Fri, 5 Mar 2010 15:18:37 +0000 (16:18 +0100)] 
[MINOR] proto_uxst: set accept_date upon accept() to the wall clock time

This accept_date field was not set and will be reported in the stats as
the connection's accept date.

15 years ago[BUG] http: don't wait for response data to leave buffer is client has left
Willy Tarreau [Fri, 5 Mar 2010 09:41:54 +0000 (10:41 +0100)] 
[BUG] http: don't wait for response data to leave buffer is client has left

In case of pipelined requests, if the client aborts before reading response
N-1, haproxy waits forever for the data to leave the buffer before parsing
the next response.

15 years ago[CLEANUP] session: remove duplicate test
Willy Tarreau [Fri, 5 Mar 2010 09:11:01 +0000 (10:11 +0100)] 
[CLEANUP] session: remove duplicate test

This duplicate test should have been removed with the loop rework but was forgotten.
It was harmless, but disassembly shows that it prevents gcc from correctly optimizing
the loop.

15 years ago[RELEASE] Released version 1.4.1 v1.4.1
Willy Tarreau [Thu, 4 Mar 2010 22:39:19 +0000 (23:39 +0100)] 
[RELEASE] Released version 1.4.1

Released version 1.4.1 with the following main changes :
    - [BUG] Clear-cookie path issue
    - [DOC] fix typo on stickiness rules
    - [BUILD] fix BSD and OSX makefiles for missing files
    - [BUILD] includes order breaks OpenBSD build
    - [BUILD] fix some build warnings on Solaris with is* macros
    - [BUG] logs: don't report "last data" when we have just closed after an error
    - [BUG] logs: don't report "proxy request" when server closes early
    - [BUILD] fix platform-dependant build issues related to crypt()
    - [STATS] count transfer aborts caused by client and by server
    - [STATS] frontend requests were not accounted for failed requests
    - [MINOR] report total number of processed connections when stopping a proxy
    - [DOC] be more clear about the limitation to one single monitor-net entry

15 years ago[DOC] be more clear about the limitation to one single monitor-net entry
Willy Tarreau [Thu, 4 Mar 2010 22:36:33 +0000 (23:36 +0100)] 
[DOC] be more clear about the limitation to one single monitor-net entry

It was not clear in the doc that only one monitor-net entry is supported.

15 years ago[BUG] Clear-cookie path issue
William Turner [Mon, 1 Mar 2010 18:30:34 +0000 (13:30 -0500)] 
[BUG] Clear-cookie path issue

We have been using haproxy to balance a not very well written application
(http://www.blackboard.com/). Using the "insert postonly indirect" cookie
method, I was attempting to remove the cookie when users would logout,
allowing the machine to re-balance for the next user (this application is
used in school computer labs, so a computer might stay on the whole day
but be used on and off).

I was having a lot of trouble because when the cookie was set, it was with
"Path=/", but when being cleared there was no "Path" in the set cookie
header, and because the logout page was in a different place of the
website (which I couldn't change), the cookie would not be cleared. I
don't know if this would be a problem for anyone other than me (as our
HTTP application is so un-adjustable), but just in case, I have included
the patch I used. Maybe it will help someone else.

[ WT: this was a correct fix, and I also added the same missing path to
  the set-cookie option ]

15 years ago[MINOR] report total number of processed connections when stopping a proxy
Willy Tarreau [Thu, 4 Mar 2010 22:07:28 +0000 (23:07 +0100)] 
[MINOR] report total number of processed connections when stopping a proxy

It's sometimes convenient to know if a proxy has processed any connection
at all when stopping it. Since a soft restart causes the "Proxy stopped"
message to be logged for each proxy, let's add the number of connections
so that it's possible afterwards to check whether a proxy had received
any connection.

15 years ago[STATS] frontend requests were not accounted for failed requests
Willy Tarreau [Thu, 4 Mar 2010 22:02:38 +0000 (23:02 +0100)] 
[STATS] frontend requests were not accounted for failed requests

But failed requests were accounted for, resulting in more failures
than requests.

15 years ago[STATS] count transfer aborts caused by client and by server
Willy Tarreau [Thu, 4 Mar 2010 19:34:23 +0000 (20:34 +0100)] 
[STATS] count transfer aborts caused by client and by server

Often we need to understand why some transfers were aborted or what
constitutes server response errors. With those two counters, it is
now possible to detect an unexpected transfer abort during a data
phase (eg: too short HTTP response), and to know what part of the
server response errors may in fact be assigned to aborted transfers.

15 years ago[BUILD] fix platform-dependant build issues related to crypt()
Willy Tarreau [Thu, 4 Mar 2010 18:10:14 +0000 (19:10 +0100)] 
[BUILD] fix platform-dependant build issues related to crypt()

Holger Just and Ross West reported build issues on FreeBSD and
Solaris that were initially caused by the definition of
_XOPEN_SOURCE at the top of auth.c, which was required on Linux
to avoid a build warning.

Krzysztof Oledzki found that using _GNU_SOURCE instead also worked
on Linux and did not cause any issue on several versions of FreeBSD.
Solaris still reported a warning this time, which was fixed by
including <crypt.h>, which itself is not present on FreeBSD nor on
all Linux toolchains.

So by adding a new build option (NEED_CRYPT_H), we can get Solaris
to get crypt() working and stop complaining at the same time, without
impacting other platforms.

This fix was tested at least on several linux toolchains (at least
uclibc, glibc 2.2.5, 2.3.6 and 2.7), on FreeBSD 4 to 8, Solaris 8
(which needs crypt.h), and AIX 5.3 (without crypt.h).

Every time it builds without a warning.

15 years ago[BUG] logs: don't report "proxy request" when server closes early
Willy Tarreau [Thu, 4 Mar 2010 17:14:51 +0000 (18:14 +0100)] 
[BUG] logs: don't report "proxy request" when server closes early

A copy-paste typo and a missing check were causing the logs to
report "PR" instead of "SD" when a server closes before sending
full data. Also, the log would erroneously report 502 while in
fact the correct response will already have been transmitted.

15 years ago[BUG] logs: don't report "last data" when we have just closed after an error
Willy Tarreau [Thu, 4 Mar 2010 16:54:21 +0000 (17:54 +0100)] 
[BUG] logs: don't report "last data" when we have just closed after an error

Some people have reported seeing "SL" flags in their logs quite often while
this should never happen. The reason was that then a server error is detected,
we close the connection to that server and when we decide what state we were
in, we see the connection is closed, and deduce it was the last data transfer,
which is wrong. We should report DATA if the previous state was an established
state, which this patch does.

Now logs correctly report "SD" and not "SL" when a server resets a connection
before the end of the transfer.

15 years ago[BUILD] fix some build warnings on Solaris with is* macros
Willy Tarreau [Tue, 2 Mar 2010 23:16:00 +0000 (00:16 +0100)] 
[BUILD] fix some build warnings on Solaris with is* macros

isalnum, isdigit and friends are really annoying because they take
an int in which we should pass an unsigned char, while strings
everywhere use chars. Solaris uses macros relying on an array for
those functions, which easily triggers some warnings showing where
we have mistakenly passed a char instead of an unsigned char or an
int. Those warnings may indicate real bugs on some platforms
depending on the implementation.

15 years ago[BUILD] includes order breaks OpenBSD build
Willy Tarreau [Fri, 26 Feb 2010 21:00:19 +0000 (22:00 +0100)] 
[BUILD] includes order breaks OpenBSD build

Jeff Buchbinder reported that OpenBSD build broke on compat.h,
and that this patch fixes the issue.

15 years ago[BUILD] fix BSD and OSX makefiles for missing files
Willy Tarreau [Fri, 26 Feb 2010 20:36:32 +0000 (21:36 +0100)] 
[BUILD] fix BSD and OSX makefiles for missing files

Jeff Buchbinder reported that OpenBSD build broke because recently
added files were not ported to BSD and OSX makefiles.

15 years ago[DOC] fix typo on stickiness rules
Willy Tarreau [Fri, 26 Feb 2010 18:15:04 +0000 (19:15 +0100)] 
[DOC] fix typo on stickiness rules

15 years ago[RELEASE] Released version 1.4.0 v1.4.0
Willy Tarreau [Fri, 26 Feb 2010 13:55:22 +0000 (14:55 +0100)] 
[RELEASE] Released version 1.4.0

Released version 1.4.0 with the following main changes :
    - [MINOR] stats: report maint state for tracking servers too
    - [DOC] fix summary to add pattern extraction
    - [DOC] Documentation cleanups
    - [BUG] cfgparse memory leak and missing free calls in deinit()
    - [BUG] pxid/puid/luid: don't shift IDs when some of them are forced
    - [EXAMPLES] add auth.cfg
    - [BUG] uri_auth: ST_SHLGNDS should be 0x00000008 not 0x0000008
    - [BUG] uri_auth: do not attemp to convert uri_auth -> http-request more than once
    - [BUILD] auth: don't use unnamed unions
    - [BUG] config: report unresolvable host names as errors
    - [BUILD] fix build breakage with DEBUG_FULL
    - [DOC] fix a typo about timeout check and clarify the explanation.
    - [MEDIUM] http: don't use trash to realign large buffers
    - [STATS] report HTTP requests (total and rate) in frontends
    - [STATS] separate frontend and backend HTTP stats
    - [MEDIUM] http: revert to use a swap buffer for realignment
    - [MINOR] stats: report the request rate in frontends as cell titles
    - [MINOR] stats: mark areas with an underline when tooltips are available
    - [DOC] reorder some entries to maintain the alphabetical order
    - [DOC] cleanup of the keyword matrix

15 years ago[DOC] cleanup of the keyword matrix
Willy Tarreau [Fri, 26 Feb 2010 12:34:29 +0000 (13:34 +0100)] 
[DOC] cleanup of the keyword matrix

The keyword matrix was barely readable due to the long lines.
Also let's repeat the legend every 24 lines.

15 years ago[DOC] reorder some entries to maintain the alphabetical order
Willy Tarreau [Fri, 26 Feb 2010 11:56:52 +0000 (12:56 +0100)] 
[DOC] reorder some entries to maintain the alphabetical order

15 years ago[MINOR] stats: mark areas with an underline when tooltips are available
Willy Tarreau [Fri, 26 Feb 2010 11:29:07 +0000 (12:29 +0100)] 
[MINOR] stats: mark areas with an underline when tooltips are available

There are many information available in the stats page that can only
be seen when the mouse hovers over them. But it's hard to know where
those information are. Now with a discrete dotted underline it's easier
to spot those areas.

15 years ago[MINOR] stats: report the request rate in frontends as cell titles
Willy Tarreau [Fri, 26 Feb 2010 10:35:39 +0000 (11:35 +0100)] 
[MINOR] stats: report the request rate in frontends as cell titles

The current and max request rates are now reported when the mouse flies
over the session rate cur/max. The total requests is displayed with the
status codes over the total sessions cell.

15 years ago[MEDIUM] http: revert to use a swap buffer for realignment
Willy Tarreau [Fri, 26 Feb 2010 10:12:27 +0000 (11:12 +0100)] 
[MEDIUM] http: revert to use a swap buffer for realignment

The bounce realign function was algorithmically good but as expected
it was not cache-friendly. Using it with large requests caused so many
cache thrashing that the function itself could drain 70% of the total
CPU time for only 0.5% of the calls !

Revert back to a standard memcpy() using a specially allocated swap
buffer. We're now back to 2M req/s on pipelined requests.

15 years ago[STATS] separate frontend and backend HTTP stats
Willy Tarreau [Fri, 26 Feb 2010 09:30:28 +0000 (10:30 +0100)] 
[STATS] separate frontend and backend HTTP stats

It is wrong to merge FE and BE stats for a proxy because when we consult a
BE's stats, it reflects the FE's stats eventhough the BE has received no
traffic. The most common example happens with listen instances, where the
backend gets credited for all the trafic even when a use_backend rule makes
use of another backend.

15 years ago[STATS] report HTTP requests (total and rate) in frontends
Willy Tarreau [Fri, 26 Feb 2010 09:05:55 +0000 (10:05 +0100)] 
[STATS] report HTTP requests (total and rate) in frontends

Now that we support keep-alive, it's important to report a separate
counter for requests. Right now it just appears in the CSV output.

15 years ago[MEDIUM] http: don't use trash to realign large buffers
Willy Tarreau [Thu, 25 Feb 2010 22:54:31 +0000 (23:54 +0100)] 
[MEDIUM] http: don't use trash to realign large buffers

The trash buffer may now be smaller than a buffer because we can tune
it at run time. This causes a risk when we're trying to use it as a
temporary buffer to realign unaligned requests, because we may have to
put up to a full buffer into it.

Instead of doing a double copy, we're now relying on an open-coded
bouncing copy algorithm. The principle is that we move one byte at
a time to its final place, and if that place also holds a byte, then
we move it too, and so on. We finish when we've moved all the buffer.
It limits the number of memory accesses, but since it proceeds one
byte at a time and with random walk, it's not cache friendly and
should be slower than a double copy. However, it's only used in
extreme situations and the difference will not be noticeable.

It has been extensively tested and works reliably.

15 years ago[BUG] uri_auth: do not attemp to convert uri_auth -> http-request more than once
Krzysztof Piotr Oledzki [Mon, 22 Feb 2010 19:27:23 +0000 (20:27 +0100)] 
[BUG] uri_auth: do not attemp to convert uri_auth -> http-request more than once

Bug reported by Laurent Dolosor.

15 years ago[BUG] uri_auth: ST_SHLGNDS should be 0x00000008 not 0x0000008
Krzysztof Piotr Oledzki [Mon, 22 Feb 2010 18:29:40 +0000 (19:29 +0100)] 
[BUG] uri_auth: ST_SHLGNDS should be 0x00000008 not 0x0000008

15 years ago[DOC] fix a typo about timeout check and clarify the explanation.
Willy Tarreau [Wed, 10 Feb 2010 04:10:19 +0000 (05:10 +0100)] 
[DOC] fix a typo about timeout check and clarify the explanation.

15 years ago[BUILD] fix build breakage with DEBUG_FULL
Willy Tarreau [Tue, 9 Feb 2010 19:55:44 +0000 (20:55 +0100)] 
[BUILD] fix build breakage with DEBUG_FULL

Paul Hirose reported a build error when DEBUG_FULL is set.

15 years ago[BUG] config: report unresolvable host names as errors
Willy Tarreau [Tue, 9 Feb 2010 19:50:45 +0000 (20:50 +0100)] 
[BUG] config: report unresolvable host names as errors

When a host name could not be resolved, an alert was emitted but the
service used to start with 0.0.0.0 for the IP address, because the
address parsing functions could not report an error. This is now
changed. This fix must be backported to 1.3 as it was first discovered
there.

15 years ago[EXAMPLES] add auth.cfg
Krzysztof Piotr Oledzki [Sun, 7 Feb 2010 15:50:08 +0000 (16:50 +0100)] 
[EXAMPLES] add auth.cfg

15 years ago[DOC] Documentation cleanups
Cyril Bonté [Sat, 6 Feb 2010 13:44:47 +0000 (14:44 +0100)] 
[DOC] Documentation cleanups

Hi Willy,

This patch make some cleanups on the documentation :
- strictly respect the 80 columns constraint
- use space indentation everywhere
- add some missing "(deprecated)"
- fix the "monitor fail" keyword syntax
- fix a keyword in a "See Also" line (interval instead of inter)
- the "no" prefix of "option http-use-proxy-header" is displayed as the others

I've also noticed that 3 keywords are missing from the keywords reference (I don't know what to do for that) :
- dispatch
- reqsetbe
- reqisetbe

--
Cyril Bonté

15 years ago[BUG] pxid/puid/luid: don't shift IDs when some of them are forced
Krzysztof Piotr Oledzki [Fri, 5 Feb 2010 19:58:27 +0000 (20:58 +0100)] 
[BUG] pxid/puid/luid: don't shift IDs when some of them are forced

[WT: it was not a bug, I did it on purpose to leave no hole between IDs,
 though it's not very practical when admins want to force some entries
 after they have been used, because they'd rather leave a hole than
 renumber everything ]

Forcing some of IDs should not shift others.

Regression introduced in 53fb4ae261b6e0e33e618f5cabbacc1657c19cc5

---cut here---
global
        stats socket /home/ole/haproxy.stat user ole group ole mode 660

frontend F1
        bind 127.0.0.1:9999
        mode http

backend B1
        mode http

backend B2
        mode http
        id 9999

backend B3
        mode http

backend B4
        mode http
---cut here---

Before 53fb4ae261b6e0e33e618f5cabbacc1657c19cc5:
$ echo "show stat" | socat unix-connect:/home/ole/haproxy.stat stdio|cut -d , -f 28
iid
1
2
9999
4
5

After 53fb4ae261b6e0e33e618f5cabbacc1657c19cc5:
$ echo "show stat" | socat unix-connect:/home/ole/haproxy.stat stdio|cut -d , -f 28
iid
1
2
9999
3
4

With this patch:
$ echo "show stat" | socat unix-connect:/home/ole/haproxy.stat stdio|cut -d , -f 28
iid
1
2
9999
4
5

15 years ago[BUG] cfgparse memory leak and missing free calls in deinit()
Krzysztof Piotr Oledzki [Fri, 5 Feb 2010 19:31:44 +0000 (20:31 +0100)] 
[BUG] cfgparse memory leak and missing free calls in deinit()

Thich patch fixes cfgparser not to leak memory on each
default server statement and adds several missing free
calls in deinit():
 - free(l->name)
 - free(l->counters)
 - free(p->desc);
 - free(p->fwdfor_hdr_name);

None of them are critical, hopefully.

15 years ago[DOC] fix summary to add pattern extraction
Cyril Bonté [Wed, 3 Feb 2010 19:41:26 +0000 (20:41 +0100)] 
[DOC] fix summary to add pattern extraction

15 years ago[MINOR] stats: report maint state for tracking servers too
Cyril Bonté [Tue, 2 Feb 2010 23:26:28 +0000 (00:26 +0100)] 
[MINOR] stats: report maint state for tracking servers too

This is to avoid confusing a real server failure and a tracking server
which is marked down because the tracked server was switched to MAINT.

15 years ago[BUILD] auth: don't use unnamed unions
Willy Tarreau [Tue, 2 Feb 2010 10:28:20 +0000 (11:28 +0100)] 
[BUILD] auth: don't use unnamed unions

unnamed unions are not compatible with older compilers (eg: gcc 2.95) so
name it "u" instead.

15 years ago[RELEASE] Released version 1.4-rc1 v1.4-rc1
Willy Tarreau [Tue, 2 Feb 2010 09:18:28 +0000 (10:18 +0100)] 
[RELEASE] Released version 1.4-rc1

Released version 1.4-rc1 with the following main changes :
    - [MEDIUM] add a maintenance mode to servers
    - [MINOR] http-auth: last fix was wrong
    - [CONTRIB] add base64rev-gen.c that was used to generate the base64rev table.
    - [MINOR] Base64 decode
    - [MINOR] generic auth support with groups and encrypted passwords
    - [MINOR] add ACL_TEST_F_NULL_MATCH
    - [MINOR] http-request: allow/deny/auth support for frontend/backend/listen
    - [MINOR] acl: add http_auth and http_auth_group
    - [MAJOR] use the new auth framework for http stats
    - [DOC] add info about userlists, http-request and http_auth/http_auth_group acls
    - [STATS] make it possible to change a CLI connection timeout
    - [BUG] patterns: copy-paste typo in type conversion arguments
    - [MINOR] pattern: make the converter more flexible by supporting void* and int args
    - [MINOR] standard: str2mask: string to netmask converter
    - [MINOR] pattern: add support for argument parsers for converters
    - [MINOR] pattern: add the "ipmask()" converting function
    - [MINOR] config: off-by-one in "stick-table" after list of converters
    - [CLEANUP] acl, patterns: make use of my_strndup() instead of malloc+memcpy
    - [BUG] restore accidentely removed line in last patch !
    - [MINOR] checks: make the HTTP check code add the CRLF itself
    - [MINOR] checks: add the server's status in the checks
    - [BUILD] halog: make without arch-specific optimizations
    - [BUG] halog: fix segfault in case of empty log in PCT mode (cherry picked from commit fe362fe4762151d209b9656639ee1651bc2b329d)
    - [MINOR] http: disable keep-alive when process is going down
    - [MINOR] acl: add build_acl_cond() to make it easier to add ACLs in config
    - [CLEANUP] config: use build_acl_cond() instead of parse_acl_cond()
    - [CLEANUP] config: use warnif_cond_requires_resp() to check for bad ACLs
    - [MINOR] prepare req_*/rsp_* to receive a condition
    - [CLEANUP] config: specify correct const char types to warnif_* functions
    - [MEDIUM] config: factor out the parsing of 20 req*/rsp* keywords
    - [MEDIUM] http: make the request filter loop check for optional conditions
    - [MEDIUM] http: add support for conditional request filter execution
    - [DOC] add some build info about the AIX platform (cherry picked from commit e41914c77edbc40aebf827b37542d37d758e371e)
    - [MEDIUM] http: add support for conditional request header addition
    - [MEDIUM] http: add support for conditional response header rewriting
    - [DOC] add some missing ACLs about response header matching
    - [MEDIUM] http: add support for proxy authentication
    - [MINOR] http-auth: make the 'unless' keyword work as expected
    - [CLEANUP] config: use build_acl_cond() to simplify http-request ACL parsing
    - [MEDIUM] add support for anonymous ACLs
    - [MEDIUM] http: switch to tunnel mode after status 101 responses
    - [MEDIUM] http: stricter processing of the CONNECT method
    - [BUG] config: reset check request to avoid double free when switching to ssl/sql
    - [MINOR] config: fix too large ssl-hello-check message.
    - [BUG] fix error response in case of server error

15 years ago[BUG] fix error response in case of server error
Willy Tarreau [Tue, 2 Feb 2010 08:57:24 +0000 (09:57 +0100)] 
[BUG] fix error response in case of server error

The fix below was incomplete :
    commit d5fd51c75be6479539228f84377622a986b23be2

    [BUG] http_server_error() must not purge a previous pending response

    This can cause parts of responses to be truncated in case of
    pipelined requests if the second request generates an error
    before the first request is completely flushed.

Pending response data being rejected was still sent, causing inappropriate
error responses in case of error while parsing a response header. We must
purge pending data from the response buffer that were not scheduled to be
sent (l - send_max).

15 years ago[DOC] add info about userlists, http-request and http_auth/http_auth_group acls
Krzysztof Piotr Oledzki [Mon, 1 Feb 2010 22:35:44 +0000 (23:35 +0100)] 
[DOC] add info about userlists, http-request and http_auth/http_auth_group acls

15 years ago[MINOR] config: fix too large ssl-hello-check message.
Willy Tarreau [Mon, 1 Feb 2010 15:38:17 +0000 (16:38 +0100)] 
[MINOR] config: fix too large ssl-hello-check message.

As reported by Cyril Bonté and Hervé Commowick, the ssl-hello-check
should use sizeof()-1 and not sizeof() for the message length.

15 years ago[BUG] config: reset check request to avoid double free when switching to ssl/sql
Willy Tarreau [Mon, 1 Feb 2010 15:31:14 +0000 (16:31 +0100)] 
[BUG] config: reset check request to avoid double free when switching to ssl/sql

SSL and SQL checks did only perform a free() of the request without replacing
it, so having multiple SSL/SQL check declarations after another check type
causes a double free condition during config parsing. This should be backported
although it's harmless.

15 years ago[MEDIUM] http: stricter processing of the CONNECT method
Willy Tarreau [Mon, 1 Feb 2010 15:20:08 +0000 (16:20 +0100)] 
[MEDIUM] http: stricter processing of the CONNECT method

Now we establish the tunnel only once the status 200 reponse is
received. That way we can still support an authentication request
in response to a CONNECT, then a client's authentication response.

15 years ago[MEDIUM] http: switch to tunnel mode after status 101 responses
Willy Tarreau [Mon, 1 Feb 2010 14:13:32 +0000 (15:13 +0100)] 
[MEDIUM] http: switch to tunnel mode after status 101 responses

A 101 response is accompanied with an Upgrade header indicating
a new protocol that is spoken on the connection after the exchange
completes. At least we should switch to tunnel mode after such a
response.

15 years ago[MEDIUM] add support for anonymous ACLs
Willy Tarreau [Mon, 1 Feb 2010 12:05:50 +0000 (13:05 +0100)] 
[MEDIUM] add support for anonymous ACLs

Anonymous ACLs allow the declaration of rules which rely directly on
ACL expressions without passing via the declaration of an ACL. Example :

   With named ACLs :

        acl site_dead nbsrv(dynamic) lt 2
        acl site_dead nbsrv(static)  lt 2
        monitor fail  if site_dead

   With anonymous ACLs :

        monitor fail if { nbsrv(dynamic) lt 2 } || { nbsrv(static) lt 2 }

15 years ago[MINOR] http-auth: last fix was wrong
Krzysztof Olędzki [Mon, 1 Feb 2010 11:36:53 +0000 (12:36 +0100)] 
[MINOR] http-auth: last fix was wrong

I'm not sure if the fix is correct:

- if (req_acl->cond)
-         ret = acl_exec_cond(req_acl->cond, px, s, txn, ACL_DIR_REQ);
+ if (!req_acl->cond)
+         continue;

Doesn't it ignore rules with no condition attached? I think that the
proper solution would be the following.

15 years ago[CLEANUP] config: use build_acl_cond() to simplify http-request ACL parsing
Willy Tarreau [Mon, 1 Feb 2010 09:43:44 +0000 (10:43 +0100)] 
[CLEANUP] config: use build_acl_cond() to simplify http-request ACL parsing

Now that we have this new function to make your life better, use it.

15 years ago[MINOR] http-auth: make the 'unless' keyword work as expected
Willy Tarreau [Mon, 1 Feb 2010 09:40:19 +0000 (10:40 +0100)] 
[MINOR] http-auth: make the 'unless' keyword work as expected

One check was missing for the 'polarity' of the test. Now 'unless'
works. BTW, 'unless' provides a nice way to perform one-line auth :

    acl valid-user http_auth(user-list)
    http-request auth unless valid-user

15 years ago[MEDIUM] add a maintenance mode to servers
Cyril Bonté [Sun, 31 Jan 2010 21:34:03 +0000 (22:34 +0100)] 
[MEDIUM] add a maintenance mode to servers

This is a first attempt to add a maintenance mode on servers, using
the stat socket (in admin level).

It can be done with the following command :
   - disable server <backend>/<server>
   - enable  server <backend>/<server>

In this mode, no more checks will be performed on the server and it
will be marked as a special DOWN state (MAINT).

If some servers were tracking it, they'll go DOWN until the server
leaves the maintenance mode. The stats page and the CSV export also
display this special state.

This can be used to disable the server in haproxy before doing some
operations on this server itself. This is a good complement to the
"http-check disable-on-404" keyword and works in TCP mode.

15 years ago[MEDIUM] http: add support for proxy authentication
Willy Tarreau [Sun, 31 Jan 2010 20:46:18 +0000 (21:46 +0100)] 
[MEDIUM] http: add support for proxy authentication

We're already able to know if a request is a proxy request or a
normal one, and we have an option "http-use-proxy-header" which states
that proxy headers must be checked. So let's switch to use the proxy
authentication headers and responses when this option is set and we're
facing a proxy request. That allows haproxy to enforce auth in front
of a proxy.

15 years ago[MAJOR] use the new auth framework for http stats
Krzysztof Piotr Oledzki [Fri, 29 Jan 2010 18:29:32 +0000 (19:29 +0100)] 
[MAJOR] use the new auth framework for http stats

Support the new syntax (http-request allow/deny/auth) in
http stats.

Now it is possible to use the same syntax is the same like in
the frontend/backend http-request access control:
 acl src_nagios src 192.168.66.66
 acl stats_auth_ok http_auth(L1)

 stats http-request allow if src_nagios
 stats http-request allow if stats_auth_ok
 stats http-request auth realm LB

The old syntax is still supported, but now it is emulated
via private acls and an aditional userlist.

15 years ago[MINOR] acl: add http_auth and http_auth_group
Krzysztof Piotr Oledzki [Fri, 29 Jan 2010 18:26:18 +0000 (19:26 +0100)] 
[MINOR] acl: add http_auth and http_auth_group

Add two acls to match http auth data:
 acl <name> http_auth(userlist)
 acl <name> http_auth_hroup(userlist) group1 group2 (...)

15 years ago[MINOR] http-request: allow/deny/auth support for frontend/backend/listen
Krzysztof Piotr Oledzki [Fri, 29 Jan 2010 16:58:21 +0000 (17:58 +0100)] 
[MINOR] http-request: allow/deny/auth support for frontend/backend/listen

Use the generic auth framework to control access to frontends/backends/listens

15 years ago[MINOR] add ACL_TEST_F_NULL_MATCH
Krzysztof Piotr Oledzki [Fri, 29 Jan 2010 16:55:53 +0000 (17:55 +0100)] 
[MINOR] add ACL_TEST_F_NULL_MATCH

Add ACL_TEST_F_NULL_MATCH so expr->kw->match can be called
even if expr->patterns is empty.

15 years ago[MINOR] generic auth support with groups and encrypted passwords
Krzysztof Piotr Oledzki [Fri, 29 Jan 2010 16:50:44 +0000 (17:50 +0100)] 
[MINOR] generic auth support with groups and encrypted passwords

Add generic authentication & authorization support.

Groups are implemented as bitmaps so the count is limited to
sizeof(int)*8 == 32.

Encrypted passwords are supported with libcrypt and crypt(3), so it is
possible to use any method supported by your system. For example modern
Linux/glibc instalations support MD5/SHA-256/SHA-512 and of course classic,
DES-based encryption.

15 years ago[MINOR] Base64 decode
Krzysztof Piotr Oledzki [Fri, 29 Jan 2010 12:36:23 +0000 (13:36 +0100)] 
[MINOR] Base64 decode

Implement Base64 decoding with a reverse table.

The function accepts and decodes classic base64 strings, which
can be composed from many streams as long each one is properly
padded, for example: SGVsbG8=IEhBUHJveHk=IQ==

15 years ago[CONTRIB] add base64rev-gen.c that was used to generate the base64rev table.
Krzysztof Piotr Oledzki [Tue, 26 Jan 2010 11:32:49 +0000 (12:32 +0100)] 
[CONTRIB] add base64rev-gen.c that was used to generate the base64rev table.

There is no offcial reverse table for base64, so a short
program is required to generate one.

15 years ago[DOC] add some missing ACLs about response header matching
Willy Tarreau [Sun, 31 Jan 2010 14:54:35 +0000 (15:54 +0100)] 
[DOC] add some missing ACLs about response header matching

15 years ago[MEDIUM] http: add support for conditional response header rewriting
Willy Tarreau [Sun, 31 Jan 2010 14:43:27 +0000 (15:43 +0100)] 
[MEDIUM] http: add support for conditional response header rewriting

Just as for the req* rules, we can now condition rsp* rules with ACLs.
ACLs match on response, so volatile request information cannot be used.
A warning is emitted if a configuration contains such an anomaly.

15 years ago[MEDIUM] http: add support for conditional request header addition
Willy Tarreau [Sun, 31 Jan 2010 13:30:44 +0000 (14:30 +0100)] 
[MEDIUM] http: add support for conditional request header addition

Now the reqadd rules also support ACLs. All req* rules are converted
now.

15 years ago[DOC] add some build info about the AIX platform
Willy Tarreau [Thu, 28 Jan 2010 19:52:05 +0000 (20:52 +0100)] 
[DOC] add some build info about the AIX platform
(cherry picked from commit e41914c77edbc40aebf827b37542d37d758e371e)