]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
15 years ago[MINOR] Collect & provide http response codes for frontends, fix backends
Krzysztof Piotr Oledzki [Sat, 24 Oct 2009 13:36:15 +0000 (15:36 +0200)] 
[MINOR] Collect & provide http response codes for frontends, fix backends

This patch extends and corrects the functionality introduced by
"Collect & provide http response codes received from servers":
 - responses are now also accounted for frontends
 - backend's and frontend's counters are incremented based
   on responses sent to client, not received from servers

15 years ago[MINOR] add additional "a href"s to stats page
Krzysztof Piotr Oledzki [Sat, 24 Oct 2009 12:24:30 +0000 (14:24 +0200)] 
[MINOR] add additional "a href"s to stats page

This patch adds <a href> html links for proxies, frontends, servers
and backends. Once located, can be clicked. Users no longer have to
manually add #anchor to stat's url.

15 years ago[BUG] definitely fix regparm issues between haproxy core and ebtree
Willy Tarreau [Tue, 27 Oct 2009 20:40:18 +0000 (21:40 +0100)] 
[BUG] definitely fix regparm issues between haproxy core and ebtree

It's a pain to enable regparm because ebtree is built in its corner
and does not depend on the rest of the config. This causes no problem
except that if the regparm settings are not exactly similar, then we
can get inconsistent function interfaces and crashes.

One solution realized in this patch consists in externalizing all
compiler settings and changing CONFIG_XXX_REGPARM into CONFIG_REGPARM
so that we ensure that any sub-component uses the same setting. Since
ebtree used a value here and not a boolean, haproxy's config has been
set to use a number too. Both haproxy's core and ebtree currently use
the same copy of the compiler.h file. That way we don't have any issue
anymore when one setting changes somewhere.

15 years ago[CLEANUP] ebtree: remove old unused files
Willy Tarreau [Mon, 26 Oct 2009 20:15:10 +0000 (21:15 +0100)] 
[CLEANUP] ebtree: remove old unused files

15 years ago[MEDIUM] build: switch ebtree users to use new ebtree version
Willy Tarreau [Mon, 26 Oct 2009 20:10:04 +0000 (21:10 +0100)] 
[MEDIUM] build: switch ebtree users to use new ebtree version

All files referencing the previous ebtree code were changed to point
to the new one in the ebtree directory. A makefile variable (EBTREE_DIR)
is also available to use files from another directory.

The ability to build the libebtree library temporarily remains disabled
because it can have an impact on some existing toolchains and does not
appear worth it in the medium term if we add support for multi-criteria
stickiness for instance.

15 years ago[IMPORT] import ebtree v5.0 into directory ebtree/
Willy Tarreau [Mon, 26 Oct 2009 18:48:54 +0000 (19:48 +0100)] 
[IMPORT] import ebtree v5.0 into directory ebtree/

We needed to upgrade ebtree to v5.0 to support string indexing,
and it was getting very painful to have it split across 2 dirs
and to have to patch it. Now we just have to copy the .c and .h
files to the right place.

15 years ago[MINOR] Add "a name" to stats page
Krzysztof Piotr Oledzki [Thu, 22 Oct 2009 20:48:09 +0000 (22:48 +0200)] 
[MINOR] Add "a name" to stats page

If you have a lot of proxies/servers in your stats page it is
not easy to locate the one you are interested in. You can
of couse use search function from you favorite web browser
but browsers often lost their focus when reloading stats.

This patch adds <a name> html tags for proxies, frontends, servers
and backends. You can use it to access a specific place, for example:

http://(stats_url)#proxy
http://(stats_url)#proxy/Frontend
http://(stats_url)#proxy/server1
http://(stats_url)#proxy/server2
http://(stats_url)#proxy/Backend

15 years ago[MINOR] http: remove the last call to stream_int_return
Willy Tarreau [Sun, 18 Oct 2009 21:56:35 +0000 (23:56 +0200)] 
[MINOR] http: remove the last call to stream_int_return

And remove the now unused function itself too.

15 years ago[MINOR] http response: update the TX_CLI_CONN_KA flag on rewrite
Willy Tarreau [Sun, 18 Oct 2009 21:52:50 +0000 (23:52 +0200)] 
[MINOR] http response: update the TX_CLI_CONN_KA flag on rewrite

If we modify the "connection" header we send to the client,
update the TX_CLI_CONN_KA flag.

15 years ago[MEDIUM] http response: check body length and set transaction flags
Willy Tarreau [Sun, 18 Oct 2009 21:45:12 +0000 (23:45 +0200)] 
[MEDIUM] http response: check body length and set transaction flags

We also check the close status and terminate the server persistent
connection if appropriate. Note that since this change, we'll not
get any "Connection: close" headers added to HTTP/1.0 responses
anymore, which is good.

15 years ago[MINOR] http: pre-set the persistent flags in the transaction
Willy Tarreau [Sun, 18 Oct 2009 21:43:57 +0000 (23:43 +0200)] 
[MINOR] http: pre-set the persistent flags in the transaction

We should pre-set the persistent flags then try to clear them
instead of the opposite.

15 years ago[MAJOR] http: create the analyser which waits for a response
Willy Tarreau [Sun, 18 Oct 2009 20:53:08 +0000 (22:53 +0200)] 
[MAJOR] http: create the analyser which waits for a response

The code part which waits for an HTTP response has been extracted
from the old function. We now have two analysers and the second one
may re-enable the first one when an 1xx response is encountered.
This has been tested and works.

The calls to stream_int_return() that were remaining in the wait
analyser have been converted to stream_int_retnclose().

15 years ago[MEDIUM] http request: make use of pre-parsed transfer-encoding header
Willy Tarreau [Sun, 18 Oct 2009 19:36:47 +0000 (21:36 +0200)] 
[MEDIUM] http request: make use of pre-parsed transfer-encoding header

This change should go a bit further. We should have a dedicated analyser
to find and skip chunks.

15 years ago[MEDIUM] http request: simplify POST length detection
Willy Tarreau [Sun, 18 Oct 2009 19:28:29 +0000 (21:28 +0200)] 
[MEDIUM] http request: simplify POST length detection

We can now rely on the pre-parsed content-length and transfer-encoding
to find what the supposed body length will be.

15 years ago[MINOR] http request: simplify the test of no-data
Willy Tarreau [Sun, 18 Oct 2009 19:17:42 +0000 (21:17 +0200)] 
[MINOR] http request: simplify the test of no-data

Now we can rely on (chunked && !hdr_content_len) to stop forwarding
data. We only do that for known methods that are not CONNECT though.

15 years ago[MINOR] http request: update the TX_SRV_CONN_KA flag on rewrite
Willy Tarreau [Sun, 18 Oct 2009 19:04:35 +0000 (21:04 +0200)] 
[MINOR] http request: update the TX_SRV_CONN_KA flag on rewrite

If we modify the "connection" header we send to the server,
update the TX_SRV_CONN_KA flag.

15 years ago[MEDIUM] http request: parse connection, content-length and transfer-encoding
Willy Tarreau [Sun, 18 Oct 2009 18:55:02 +0000 (20:55 +0200)] 
[MEDIUM] http request: parse connection, content-length and transfer-encoding

Store those elements in the transaction. RFC2616 is strictly followed.
Note that requests containing two different content-length fields are
discarded as invalid.

15 years ago[MINOR] http: add new transaction flags for keep-alive and content-length
Willy Tarreau [Sun, 18 Oct 2009 17:50:43 +0000 (19:50 +0200)] 
[MINOR] http: add new transaction flags for keep-alive and content-length

We'll need to store the keep-alive status as well as content-length
and/or transfer-encoding status.

15 years ago[MEDIUM] appsession: add the "request-learn" option
Cyril Bonté [Wed, 14 Oct 2009 22:15:40 +0000 (00:15 +0200)] 
[MEDIUM] appsession: add the "request-learn" option

This patch has 2 goals :

1. I wanted to test the appsession feature with a small PHP code,
using PHPSESSID. The problem is that when PHP gets an unknown session
id, it creates a new one with this ID. So, when sending an unknown
session to PHP, persistance is broken : haproxy won't see any new
cookie in the response and will never attach this session to a
specific server.

This also happens when you restart haproxy : the internal hash becomes
empty and all sessions loose their persistance (load balancing the
requests on all backend servers, creating a new session on each one).
For a user, it's like the service is unusable.

The patch modifies the code to make haproxy also learn the persistance
from the client : if no session is sent from the server, then the
session id found in the client part (using the URI or the client cookie)
is used to associated the server that gave the response.

As it's probably not a feature usable in all cases, I added an option
to enable it (by default it's disabled). The syntax of appsession becomes :

  appsession <cookie> len <length> timeout <holdtime> [request-learn]

This helps haproxy repair the persistance (with the risk of losing its
session at the next request, as the user will probably not be load
balanced to the same server the first time).

2. This patch also tries to reduce the memory usage.
Here is a little example to explain the current behaviour :
- Take a Tomcat server where /session.jsp is valid.
- Send a request using a cookie with an unknown value AND a path
  parameter with another unknown value :

  curl -b "JSESSIONID=12345678901234567890123456789012" http://<haproxy>/session.jsp;jsessionid=00000000000000000000000000000001

(I know, it's unexpected to have a request like that on a live service)
Here, haproxy finds the URI session ID and stores it in its internal
hash (with no server associated). But it also finds the cookie session
ID and stores it again.

- As a result, session.jsp sends a new session ID also stored in the
  internal hash, with a server associated.

=> For 1 request, haproxy has stored 3 entries, with only 1 which will be usable

The patch modifies the behaviour to store only 1 entry (maximum).

15 years ago[MAJOR] buffer: flag BF_DONT_READ to disable reads when not required
Willy Tarreau [Sat, 17 Oct 2009 12:37:52 +0000 (14:37 +0200)] 
[MAJOR] buffer: flag BF_DONT_READ to disable reads when not required

When processing a GET or HEAD request in close mode, we know we don't
need to read anything anymore on the socket, so we can disable it.
Doing this can save up to 40% of the recv calls, and half of the
epoll_ctl calls.

For this we need a buffer flag indicating that we're not interesting in
reading anymore. Right now, this flag also disables both polled reads.
We might benefit from disabling only speculative reads, but we will need
at least this flag when we want to support keepalive anyway.

Currently we don't disable the flag on completion, but it does not
matter as we close ASAP when performing the shutw().

15 years ago[MEDIUM] fd: merge fd_list into fdtab
Willy Tarreau [Sat, 17 Oct 2009 20:54:17 +0000 (22:54 +0200)] 
[MEDIUM] fd: merge fd_list into fdtab

The fd_list[] used by sepoll was indexed on the fd number and was only
used to store the equivalent of an integer. Changing it to be merged
with fdtab reduces the number of pointer computations, the code size
and some initialization steps. It does not harm other pollers much
either, as only one integer was added to the fdtab array.

15 years ago[OPTIM] move some rarely used fields out of fdtab
Willy Tarreau [Sun, 18 Oct 2009 05:25:52 +0000 (07:25 +0200)] 
[OPTIM] move some rarely used fields out of fdtab

Some rarely information are stored in fdtab, making it larger for no
reason (source port ranges, remote address, ...). Such information
lie there because the checks can't find them anywhere else. The goal
will be to move these information to the stream interface once the
checks make use of it.

For now, we move them to an fdinfo array. This simple change might
have improved the cache hit ratio a little bit because a 0.5% of
performance increase has measured.

15 years ago[CLEANUP] sepoll: clean up the fd_clr/fd_set functions
Willy Tarreau [Sat, 17 Oct 2009 19:43:03 +0000 (21:43 +0200)] 
[CLEANUP] sepoll: clean up the fd_clr/fd_set functions

This cleanup also slightly reduces code size due to a better
construct and the use of an inlined version of alloc_spec_entry().

15 years ago[MINOR] http: detect connection: close earlier
Willy Tarreau [Sat, 17 Oct 2009 18:12:21 +0000 (20:12 +0200)] 
[MINOR] http: detect connection: close earlier

Till now we would only set SN_CONN_CLOSED after rewriting it. Now we
set it just after checking the Connection header so that we can use
the result later if required.

15 years ago[DOC] option tcp-smart-connect was missing from index
Willy Tarreau [Sat, 17 Oct 2009 14:04:09 +0000 (16:04 +0200)] 
[DOC] option tcp-smart-connect was missing from index

15 years ago[BUG] Fix silly typo: hspr_other -> hrsp_other
Krzysztof Piotr Oledzki [Wed, 14 Oct 2009 20:26:01 +0000 (22:26 +0200)] 
[BUG] Fix silly typo: hspr_other -> hrsp_other

s/hspr_other/hrsp_other/

15 years ago[DOC] point to 1.4 doc, not 1.3
Willy Tarreau [Wed, 14 Oct 2009 20:22:03 +0000 (22:22 +0200)] 
[DOC] point to 1.4 doc, not 1.3

The links were wrong.

15 years ago[MINOR] Collect & provide http response codes received from servers
Krzysztof Piotr Oledzki [Tue, 13 Oct 2009 19:14:09 +0000 (21:14 +0200)] 
[MINOR] Collect & provide http response codes received from servers

Additional data is provided on both html & csv stats:
 - html: when passing a mouse over Sessions -> Total (servers, backends)
 - cvs: by 6 additional fields (hrsp_1xx, hrsp_2xx, hrsp_3xx, hrsp_4xx, hrsp_5xx, hspr_other)

Patch inspired by:
 http://www.formilux.org/archives/haproxy/0910/2528.html
 http://www.formilux.org/archives/haproxy/0910/2529.html

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

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

Patch included in my 1.3.20 Debian package is attached.

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

haproxy-en.txt and haproxy-fr.txt are outdated but people still refer to
them quite often, generally causing a useless waste of time.

15 years ago[CONTRIB] halog: support searching by response time
Willy Tarreau [Wed, 14 Oct 2009 13:16:29 +0000 (15:16 +0200)] 
[CONTRIB] halog: support searching by response time

Also support inverting search criteria when specified uppercase

15 years ago[MINOR] unix socket: report the socket path in case of bind error
Willy Tarreau [Wed, 14 Oct 2009 13:16:48 +0000 (15:16 +0200)] 
[MINOR] unix socket: report the socket path in case of bind error

When an error occurs during binding of the stats unix socket, messages
are far from clear for the user !

15 years ago[MINOR] tcp: add support for the defer_accept bind option
Willy Tarreau [Tue, 13 Oct 2009 05:34:14 +0000 (07:34 +0200)] 
[MINOR] tcp: add support for the defer_accept bind option

This can ensure that data is readily available on a socket when
we accept it, but a bug in the kernel ignores the timeout so the
socket can remain pending as long as the client does not talk.
Use with care.

15 years ago[MINOR] CSS & HTML fun
Krzysztof Piotr Oledzki [Mon, 12 Oct 2009 21:09:08 +0000 (23:09 +0200)] 
[MINOR] CSS & HTML fun

This patch makes stats page about 30% smaller and
"CSS 2.1" + "HTML 4.01 Transitional" compliant.

There should be no visible differences.

Changes:
 - add DOCTYPE for HTML 4.01 Transitional
 - add missing </ul>
 - remove cols=, AFAIK no modern browser support this property and
   it prevents validation to pass.
 - remove "align: center": there is no such property in css. There is
   however "text-align: center" but it is definitely not what we would
   like to see here.
 - by default align .titre to center
 - by default align .td to right
 - remove all align=right, no longer necessary
 - add class=ac (align center): shorter than "align=center" and use it when
   necessary
 - remove nowrap from td, instead use "white-space: nowrap" in css

Now stats page passes W3C validators for HTML & CSS. We may consider adding
"validated" icons from www.w3.org. ;)

15 years ago[MINOR] config: report all supported options for the "bind" keyword
Willy Tarreau [Mon, 12 Oct 2009 05:19:35 +0000 (07:19 +0200)] 
[MINOR] config: report all supported options for the "bind" keyword

"mss", "name" and "id" were missing.

15 years ago[RELEASE] Released version 1.4-dev4 v1.4-dev4
Willy Tarreau [Mon, 12 Oct 2009 04:40:53 +0000 (06:40 +0200)] 
[RELEASE] Released version 1.4-dev4

Released version 1.4-dev4 with the following main changes :
    - [DOC] add missing rate_lim and rate_max
    - [MAJOR] struct chunk rework
    - [MEDIUM] Health check reporting code rework + health logging, v3
    - [BUG] check if rise/fall has an argument and it is > 0
    - [MINOR] health checks logging unification
    - [MINOR] add "description", "node" and show-node"/"show-desc", remove "node-name", v2
    - [MINOR] Allow dots in show-node & add "white-space: nowrap" in th.pxname.
    - [DOC] Add information about http://haproxy.1wt.eu/contrib.html
    - [MINOR] Introduce include/types/counters.h
    - [CLEANUP] Move counters to dedicated structures
    - [MINOR] Add "clear counters" to clear statistics counters
    - [MEDIUM] Collect & provide separate statistics for sockets, v2
    - [BUG] Fix NULL pointer dereference in stats_check_uri_auth(), v2
    - [MINOR] acl: don't report valid acls as potential mistakes
    - [MINOR] Add cut_crlf(), ltrim(), rtrim() and alltrim()
    - [MINOR] Add chunk_htmlencode and chunk_asciiencode
    - [MINOR] Capture & display more data from health checks, v2
    - [BUG] task.c: don't assing last_timer to node-less entries
    - [BUG] http stats: large outputs sometimes got some parts chopped off
    - [MINOR] backend: export some functions to recount servers
    - [MINOR] backend: uninline some LB functions
    - [MINOR] include time.h from freq_ctr.h as is uses "now".
    - [CLEANUP] backend: move LB algos to individual files
    - [MINOR] lb_map: reorder code in order to ease integration of new hash functions
    - [CLEANUP] proxy: move last lb-specific bits to their respective files
    - [MINOR] backend: separate declarations of LB algos from their lookup method
    - [MINOR] backend: reorganize the LB algorithm selection
    - [MEDIUM] backend: introduce the "static-rr" LB algorithm
    - [MINOR] report list of supported pollers with -vv
    - [DOC] log-health-checks is an option, not a directive
    - [MEDIUM] new option "independant-streams" to stop updating read timeout on writes
    - [BUG] stats: don't call buffer_shutw(), but ->shutw() instead
    - [MINOR] stats: strip CR and LF from the input command line
    - [BUG] don't refresh timeouts late after detected activity
    - [MINOR] stats_dump_errors_to_buffer: use buffer_feed_chunk()
    - [MINOR] stats_dump_sess_to_buffer: use buffer_feed_chunk()
    - [MINOR] stats: make stats_dump_raw_to_buffer() use buffer_feed_chunk
    - [MEDIUM] stats: don't use s->ana_state anymore
    - [MINOR] remove now obsolete ana_state from the session struct
    - [MEDIUM] stats: make HTTP stats use an I/O handler
    - [MEDIUM] stream_int: adjust WAIT_ROOM handling
    - [BUG] config: look for ID conflicts in all sockets, not only last ones.
    - [MINOR] config: reference file and line with any listener/proxy/server declaration
    - [MINOR] config: report places of duplicate names or IDs
    - [MINOR] config: add pointer to file name in block/redirect/use_backend/monitor rules
    - [MINOR] tools: add a new get_next_id() function
    - [MEDIUM] config: automatically find unused IDs for proxies, servers and listeners
    - [OPTIM] counters: move some max numbers to the counters struct
    - [BUG] counters: fix segfault on missing counters for a listener
    - [MEDIUM] backend: implement consistent hashing variation
    - [MINOR] acl: add fe_conn, be_conn, queue, avg_queue
    - [MINOR] stats: use 'clear counters all' to clear all values
    - [MEDIUM] add access restrictions to the stats socket
    - [MINOR] buffers: add buffer_feed2() and make buffer_feed() measure string length
    - [MINOR] proxy: provide function to retrieve backend/server pointers
    - [MINOR] add the "initial weight" to the server struct.
    - [MEDIUM] stats: add the "get weight" command to report a server's weight
    - [MEDIUM] stats: add the "set weight" command
    - [BUILD] add a 'make tags' target
    - [MINOR] stats: add support for numeric IDs in set weight/get weight
    - [MINOR] stats: use a dedicated state to output static data
    - [OPTIM] stats: check free space before trying to print

15 years ago[OPTIM] stats: check free space before trying to print
Willy Tarreau [Sun, 11 Oct 2009 21:35:10 +0000 (23:35 +0200)] 
[OPTIM] stats: check free space before trying to print

This alone makes a typical HTML stats dump consume 10% CPU less,
because we avoid doing complex printf calls to drop them later.
Only a few common cases have been checked, those which are very
likely to run for nothing.

15 years ago[MINOR] stats: use a dedicated state to output static data
Willy Tarreau [Sun, 11 Oct 2009 21:12:51 +0000 (23:12 +0200)] 
[MINOR] stats: use a dedicated state to output static data

It is a bit expensive and complex to use to call buffer_feed()
directly from the request parser, and there are risks that some
output messages are lost in case of buffer full. Since most of
these messages are static, let's have a state dedicated to print
these messages and store them in a specific area shared with the
stats in the session. This both reduces code size and risks of
losing output data.

15 years ago[MINOR] stats: add support for numeric IDs in set weight/get weight
Willy Tarreau [Sat, 10 Oct 2009 20:33:08 +0000 (22:33 +0200)] 
[MINOR] stats: add support for numeric IDs in set weight/get weight

Krzysztof reported that using names only for get weight/set weight
was not enough because it's still possible to have multiple servers
with the same name (and my test config is one of those). He suggested
to be able to designate them by their unique numeric IDs by prefixing
the ID with a dash.

That way we can have :

     set weight #120/#2

as well as

     get weight static/srv1 10

15 years ago[BUILD] add a 'make tags' target
Willy Tarreau [Sat, 10 Oct 2009 20:20:44 +0000 (22:20 +0200)] 
[BUILD] add a 'make tags' target

15 years ago[MINOR] Capture & display more data from health checks, v2
Krzysztof Piotr Oledzki [Sat, 10 Oct 2009 19:06:49 +0000 (21:06 +0200)] 
[MINOR] Capture & display more data from health checks, v2

Capture & display more data from health checks, like
strerror(errno) for L4 failed checks or a first line
from a response for L7 successes/failed checks.

Non ascii or control characters are masked with
chunk_htmlencode() (html stats) or chunk_asciiencode() (logs).

15 years ago[MINOR] Add chunk_htmlencode and chunk_asciiencode
Krzysztof Piotr Oledzki [Sat, 10 Oct 2009 19:06:03 +0000 (21:06 +0200)] 
[MINOR] Add chunk_htmlencode and chunk_asciiencode

Add two functions to encode input chunk replacing
non-printable, non ascii or special characters
with:
 "&#%u;"  - chunk_htmlencode
 "<%02X>" - chunk_asciiencode

Above functions should be used when adding strings, received
from possible unsafe sources, to html stats or logs.

15 years ago[MINOR] Add cut_crlf(), ltrim(), rtrim() and alltrim()
Krzysztof Piotr Oledzki [Sat, 10 Oct 2009 18:11:17 +0000 (20:11 +0200)] 
[MINOR] Add cut_crlf(), ltrim(), rtrim() and alltrim()

Add four generic functions.

15 years ago[MEDIUM] stats: add the "set weight" command
Willy Tarreau [Sat, 10 Oct 2009 17:30:08 +0000 (19:30 +0200)] 
[MEDIUM] stats: add the "set weight" command

It is now possible to change a server's weight from the stats socket.
Just use "set weight <back>/<serv> <weight>".

15 years ago[MEDIUM] stats: add the "get weight" command to report a server's weight
Willy Tarreau [Sat, 10 Oct 2009 16:37:29 +0000 (18:37 +0200)] 
[MEDIUM] stats: add the "get weight" command to report a server's weight

This command is unrestricted and simply reports a server's weight, as
well as the weight initially configured, which at the moment are the
sames.

15 years ago[MINOR] add the "initial weight" to the server struct.
Willy Tarreau [Sat, 10 Oct 2009 17:34:06 +0000 (19:34 +0200)] 
[MINOR] add the "initial weight" to the server struct.

This one will be used when changing weights.

15 years ago[MINOR] proxy: provide function to retrieve backend/server pointers
Willy Tarreau [Sat, 10 Oct 2009 16:35:51 +0000 (18:35 +0200)] 
[MINOR] proxy: provide function to retrieve backend/server pointers

int get_backend_server(const char *bk_name, const char *sv_name,
                       struct proxy **bk, struct server **sv);

This function scans the list of backends and servers to retrieve the first
backend and the first server with the given names, and sets them in both
parameters. It returns zero if either is not found, or non-zero and sets
the ones it did not found to NULL. If a NULL pointer is passed for the
backend, only the pointer to the server will be updated.

15 years ago[MINOR] buffers: add buffer_feed2() and make buffer_feed() measure string length
Willy Tarreau [Sat, 10 Oct 2009 16:01:44 +0000 (18:01 +0200)] 
[MINOR] buffers: add buffer_feed2() and make buffer_feed() measure string length

It's inconvenient to always have to compute string lengths when calling
buffer_feed(), so change that.

15 years ago[MEDIUM] add access restrictions to the stats socket
Willy Tarreau [Sat, 10 Oct 2009 15:13:00 +0000 (17:13 +0200)] 
[MEDIUM] add access restrictions to the stats socket

The stats socket can now run at 3 different levels :
  - user
  - operator (default one)
  - admin

These levels are used to restrict access to some information
and commands. Only the admin can clear all stats. A user cannot
clear anything nor access sensible data such as sessions or
errors.

15 years ago[MINOR] stats: use 'clear counters all' to clear all values
Willy Tarreau [Sat, 10 Oct 2009 13:26:26 +0000 (15:26 +0200)] 
[MINOR] stats: use 'clear counters all' to clear all values

The most common use of "clear counters" should be to only clear
max values without affecting cumulated values, for instance,
after an incident. So we change "clear counters" to only clear
max values, and add "clear counters all" to clear all counters.

15 years ago[BUG] task.c: don't assing last_timer to node-less entries
SaVaGe [Tue, 6 Oct 2009 15:53:37 +0000 (18:53 +0300)] 
[BUG] task.c: don't assing last_timer to node-less entries

I noticed that in __eb32_insert , if the tree is empty
(root->b[EB_LEFT] == NULL) , the node.bit is not defined.
However in __task_queue there are checks:

- if (last_timer->node.bit < 0)
- if (task->wq.node.bit < last_timer->node.bit)

which might rely upon an undefined value.

This is how I see it:

1. We insert eb32_node in an empty wait queue tree for a task (called by
process_runnable_tasks() ):
Inserting into empty wait queue  &task->wq = 0x72a87c8, last_timer
pointer: (nil)

2. Then, we set the last timer to the same address:
Setting last_timer: (nil) to: 0x72a87c8

3. We get a new task to be inserted in the queue (again called by
process_runnable_tasks()) , before the __task_unlink_wq() is called for
the previous task.

4. At this point, we still have last_timer set to 0x72a87c8 , but since
it was inserted in an empty tree, it doesn't have node.bit and the
values above get dereferenced with undefined value.

The bug has no effect right now because the check for equality is still
made, so the next timer will still be queued at the right place anyway,
without any possible side-effect. But it's a pending bug waiting for a
small change somewhere to strike.

Iliya Polihronov

15 years ago[MINOR] acl: add fe_conn, be_conn, queue, avg_queue
Willy Tarreau [Sat, 10 Oct 2009 10:02:45 +0000 (12:02 +0200)] 
[MINOR] acl: add fe_conn, be_conn, queue, avg_queue

These ACLs are used to check the number of active connections on the
frontend, backend or in a backend's queue. The avg_queue returns the
average number of queued connections per server, and for this, divides
the total number of queued connections by the number of alive servers.

The dst_conn ACL has been slightly changed to more reflect its name and
original usage, which is to return the number of connections on the
destination address/port (the socket) and not the whole frontend.

15 years ago[MEDIUM] backend: implement consistent hashing variation
Willy Tarreau [Thu, 1 Oct 2009 05:52:15 +0000 (07:52 +0200)] 
[MEDIUM] backend: implement consistent hashing variation

Consistent hashing provides some interesting advantages over common
hashing. It avoids full redistribution in case of a server failure,
or when expanding the farm. This has a cost however, the hashing is
far from being perfect, as we associate a server to a request by
searching the server with the closest key in a tree. Since servers
appear multiple times based on their weights, it is recommended to
use weights larger than approximately 10-20 in order to smoothen
the distribution a bit.

In some cases, playing with weights will be the only solution to
make a server appear more often and increase chances of being picked,
so stats are very important with consistent hashing.

In order to indicate the type of hashing, use :

   hash-type map-based      (default, old one)
   hash-type consistent     (new one)

Consistent hashing can make sense in a cache farm, in order not
to redistribute everyone when a cache changes state. It could also
probably be used for long sessions such as terminal sessions, though
that has not be attempted yet.

More details on this method of hashing here :
  http://www.spiteful.com/2008/03/17/programmers-toolbox-part-3-consistent-hashing/

15 years ago[MINOR] acl: don't report valid acls as potential mistakes
Krzysztof Piotr Oledzki [Sun, 4 Oct 2009 22:23:35 +0000 (00:23 +0200)] 
[MINOR] acl: don't report valid acls as potential mistakes

Commit 404e8ab4615d564a74f92a0d3822b0292dd6224f introduced
smart checking for stupid acl typos. However, now haproxy shows
the warning even for valid acls, like this one:
acl Cookie-X-NoAccel    hdr_reg(cookie) (^|\ |;)X-NoAccel=1(;|$)

15 years ago[BUG] counters: fix segfault on missing counters for a listener
Willy Tarreau [Sun, 4 Oct 2009 22:45:38 +0000 (00:45 +0200)] 
[BUG] counters: fix segfault on missing counters for a listener

If a frontend does not set 'option socket-stats', a 'clear counters'
on the stats socket could segfault because li->counters is NULL. The
correct fix is to check for NULL before as this is a valid situation.

15 years ago[BUG] Fix NULL pointer dereference in stats_check_uri_auth(), v2
Krzysztof Piotr Oledzki [Sun, 4 Oct 2009 21:34:15 +0000 (23:34 +0200)] 
[BUG] Fix NULL pointer dereference in stats_check_uri_auth(), v2

Recent "struct chunk rework" introduced a NULL pointer dereference
and now haproxy segfaults if auth is required for stats but not found.

The reason is that size_t cannot store negative values, but current
code assumes that "len < 0" == uninitialized.

This patch fixes it.

15 years ago[OPTIM] counters: move some max numbers to the counters struct
Willy Tarreau [Sun, 4 Oct 2009 21:12:44 +0000 (23:12 +0200)] 
[OPTIM] counters: move some max numbers to the counters struct

There are a few remaining max values that need to move to counters.
Also, the counters are more often used than some config information,
so get them closer to the other useful struct members for better cache
efficiency.

15 years ago[MEDIUM] config: automatically find unused IDs for proxies, servers and listeners
Willy Tarreau [Sun, 4 Oct 2009 21:04:08 +0000 (23:04 +0200)] 
[MEDIUM] config: automatically find unused IDs for proxies, servers and listeners

Until now it was required that every custom ID was above 1000 in order to
avoid conflicts. Now we have the list of all assigned IDs and can automatically
pick the first unused one. This means that it is perfectly possible to interleave
automatic IDs with persistent IDs and the parser will automatically allocate
unused values starting with 1.

15 years ago[MINOR] tools: add a new get_next_id() function
Willy Tarreau [Sun, 4 Oct 2009 20:48:42 +0000 (22:48 +0200)] 
[MINOR] tools: add a new get_next_id() function

This function returns the next unused key in a tree. This will be
used to find spare IDs.

15 years ago[MINOR] config: add pointer to file name in block/redirect/use_backend/monitor rules
Willy Tarreau [Sun, 4 Oct 2009 20:02:50 +0000 (22:02 +0200)] 
[MINOR] config: add pointer to file name in block/redirect/use_backend/monitor rules

Those conditions already referenced the config line, but not the file.

15 years ago[MINOR] config: report places of duplicate names or IDs
Willy Tarreau [Sun, 4 Oct 2009 19:11:42 +0000 (21:11 +0200)] 
[MINOR] config: report places of duplicate names or IDs

When a name or ID conflict is detected, it is sometimes useful to know
where the other one was declared. Now that we have this information,
report it in error messages.

15 years ago[MINOR] config: reference file and line with any listener/proxy/server declaration
Willy Tarreau [Sun, 4 Oct 2009 18:54:54 +0000 (20:54 +0200)] 
[MINOR] config: reference file and line with any listener/proxy/server declaration

Those will be used later for cross-references of conflicts or errors.

15 years ago[BUG] config: look for ID conflicts in all sockets, not only last ones.
Willy Tarreau [Sun, 4 Oct 2009 19:13:39 +0000 (21:13 +0200)] 
[BUG] config: look for ID conflicts in all sockets, not only last ones.

ID conflicts between 'bind' lines were not detected due to this typo.

15 years ago[MEDIUM] Collect & provide separate statistics for sockets, v2
Krzysztof Piotr Oledzki [Sun, 4 Oct 2009 13:43:17 +0000 (15:43 +0200)] 
[MEDIUM] Collect & provide separate statistics for sockets, v2

This patch allows to collect & provide separate statistics for each socket.
It can be very useful if you would like to distinguish between traffic
generate by local and remote users or between different types of remote
clients (peerings, domestic, foreign).

Currently no "Session rate" is supported, but adding it should be possible
if we found it useful.

15 years ago[MINOR] Add "clear counters" to clear statistics counters
Krzysztof Piotr Oledzki [Sun, 4 Oct 2009 13:02:46 +0000 (15:02 +0200)] 
[MINOR] Add "clear counters" to clear statistics counters

Now, when statistics counters are moved to separate
structures, adding "clear counters" is extremely easy.

[wt: updated the help message]

15 years ago[CLEANUP] Move counters to dedicated structures
Krzysztof Piotr Oledzki [Sun, 4 Oct 2009 12:52:57 +0000 (14:52 +0200)] 
[CLEANUP] Move counters to dedicated structures

Move counters from "struct proxy" and "struct server"
to "struct pxcounters" and "struct svcounters".

This patch should make no functional change.

15 years ago[MINOR] Introduce include/types/counters.h
Krzysztof Piotr Oledzki [Sun, 4 Oct 2009 12:32:53 +0000 (14:32 +0200)] 
[MINOR] Introduce include/types/counters.h

This patch introduces include/types/counters.h that
will be used to split couters from other structures
and to create statistics for listeners.

15 years ago[DOC] Add information about http://haproxy.1wt.eu/contrib.html
Krzysztof Piotr Oledzki [Sun, 27 Sep 2009 12:20:28 +0000 (14:20 +0200)] 
[DOC] Add information about http://haproxy.1wt.eu/contrib.html

Add information about http://haproxy.1wt.eu/contrib.html in
the CONTRIB file and remove one useless comment.

15 years ago[MEDIUM] stream_int: adjust WAIT_ROOM handling
Willy Tarreau [Sun, 4 Oct 2009 15:18:35 +0000 (17:18 +0200)] 
[MEDIUM] stream_int: adjust WAIT_ROOM handling

When applets write data, they generall cannot fill the buffer, so as
soon as we find a non-empty buffer, we're sure we're missing some room.

15 years ago[MEDIUM] stats: make HTTP stats use an I/O handler
Willy Tarreau [Sun, 4 Oct 2009 13:56:38 +0000 (15:56 +0200)] 
[MEDIUM] stats: make HTTP stats use an I/O handler

Doing this, we can remove the last BF_HIJACK user and remove
produce_content(). s->data_source could also be removed but
it is currently used to detect if the stats or a server was
used.

15 years ago[MINOR] remove now obsolete ana_state from the session struct
Willy Tarreau [Sun, 4 Oct 2009 12:24:59 +0000 (14:24 +0200)] 
[MINOR] remove now obsolete ana_state from the session struct

This one is not used anymore.

15 years ago[MEDIUM] stats: don't use s->ana_state anymore
Willy Tarreau [Sun, 4 Oct 2009 12:22:18 +0000 (14:22 +0200)] 
[MEDIUM] stats: don't use s->ana_state anymore

The stats handler used to store internal states in s->ana_state. Now
we only rely on si->st0 in which we can store as many states as we
have possible outputs. This cleans up the stats code a lot and makes
it more maintainable. It has also reduced code size by a few hundred
bytes.

15 years ago[MINOR] stats: make stats_dump_raw_to_buffer() use buffer_feed_chunk
Willy Tarreau [Sun, 4 Oct 2009 09:54:04 +0000 (11:54 +0200)] 
[MINOR] stats: make stats_dump_raw_to_buffer() use buffer_feed_chunk

Same as previous change. A remaining call to stats_dump_proxy()
still prevents us from completing the update.

15 years ago[MINOR] stats_dump_sess_to_buffer: use buffer_feed_chunk()
Willy Tarreau [Sat, 3 Oct 2009 21:55:14 +0000 (23:55 +0200)] 
[MINOR] stats_dump_sess_to_buffer: use buffer_feed_chunk()

same as previous patch for this function.

15 years ago[MINOR] stats_dump_errors_to_buffer: use buffer_feed_chunk()
Willy Tarreau [Sat, 3 Oct 2009 21:49:35 +0000 (23:49 +0200)] 
[MINOR] stats_dump_errors_to_buffer: use buffer_feed_chunk()

We can simplify the code in the stats functions using buffer_feed_chunk()
instead of buffer_write_chunk(). Let's start with this function. This
patch also fixed an issue where we could dump past the end of the capture
buffer if it is shorter than the captured request.

15 years ago[BUG] don't refresh timeouts late after detected activity
Willy Tarreau [Sun, 4 Oct 2009 08:56:08 +0000 (10:56 +0200)] 
[BUG] don't refresh timeouts late after detected activity

In old versions, before 1.3.16, we had to refresh the timeouts after
each call to process_session() because the stream socket handler did
not do it. Now that the sockets can exchange data for a long period
without calling process_session(), we can detect an old activity and
refresh a timeout long after the last activity, causing too late a
detection of some timeouts.

The fix simply consists in not checking for activity anymore in
stream_sock_data_finish() but only set a timeout if it was not
previously set.

15 years ago[MINOR] stats: strip CR and LF from the input command line
Willy Tarreau [Sun, 4 Oct 2009 05:36:58 +0000 (07:36 +0200)] 
[MINOR] stats: strip CR and LF from the input command line

commands sent from certain tools (eg: telnet) will be terminated
by CRLF and not only LF. So we must suppress CR too.

15 years ago[BUG] stats: don't call buffer_shutw(), but ->shutw() instead
Willy Tarreau [Sun, 4 Oct 2009 07:16:41 +0000 (09:16 +0200)] 
[BUG] stats: don't call buffer_shutw(), but ->shutw() instead

Calling buffer_shutw() marks the buffer as closed but if it was already
closed in the other direction, the stream interface is not marked as
closed, causing infinite loops.

We took this opportunity to completely remove buffer_shutw() and buffer_shutr()
which have no reason to be used at all and which will always cause trouble
when directly called. The stats occurrence was the last one.

15 years ago[MEDIUM] new option "independant-streams" to stop updating read timeout on writes
Willy Tarreau [Sat, 3 Oct 2009 20:01:18 +0000 (22:01 +0200)] 
[MEDIUM] new option "independant-streams" to stop updating read timeout on writes

By default, when data is sent over a socket, both the write timeout and the
read timeout for that socket are refreshed, because we consider that there is
activity on that socket, and we have no other means of guessing if we should
receive data or not.

While this default behaviour is desirable for almost all applications, there
exists a situation where it is desirable to disable it, and only refresh the
read timeout if there are incoming data. This happens on sessions with large
timeouts and low amounts of exchanged data such as telnet session. If the
server suddenly disappears, the output data accumulates in the system's
socket buffers, both timeouts are correctly refreshed, and there is no way
to know the server does not receive them, so we don't timeout. However, when
the underlying protocol always echoes sent data, it would be enough by itself
to detect the issue using the read timeout. Note that this problem does not
happen with more verbose protocols because data won't accumulate long in the
socket buffers.

When this option is set on the frontend, it will disable read timeout updates
on data sent to the client. There probably is little use of this case. When
the option is set on the backend, it will disable read timeout updates on
data sent to the server. Doing so will typically break large HTTP posts from
slow lines, so use it with caution.

15 years ago[DOC] log-health-checks is an option, not a directive
Willy Tarreau [Sat, 3 Oct 2009 19:45:07 +0000 (21:45 +0200)] 
[DOC] log-health-checks is an option, not a directive

Also fix alphabetical placement of the option in the list.

15 years ago[MINOR] report list of supported pollers with -vv
Willy Tarreau [Sat, 3 Oct 2009 16:57:08 +0000 (18:57 +0200)] 
[MINOR] report list of supported pollers with -vv

During troubleshooting, it's often useful to get the list of supported
pollers but until now it was required to have a working configuration
first. Since the pollers are known before main() is called, let's list
them with the build options.

15 years ago[MEDIUM] backend: introduce the "static-rr" LB algorithm
Willy Tarreau [Sat, 3 Oct 2009 10:56:50 +0000 (12:56 +0200)] 
[MEDIUM] backend: introduce the "static-rr" LB algorithm

The "static-rr" is just the old round-robin algorithm. It is still
in use when a hash algorithm is used and the data to hash is not
present, but it was impossible to configure it explicitly. This one
is cheaper in terms of CPU and supports unlimited numbers of servers,
so it makes sense to be able to use it.

15 years ago[MINOR] backend: reorganize the LB algorithm selection
Willy Tarreau [Sat, 3 Oct 2009 10:36:05 +0000 (12:36 +0200)] 
[MINOR] backend: reorganize the LB algorithm selection

We can now factor out some common tests between all map-based
algorithms. This removes some redundancy and makes the code more
logical.

15 years ago[MINOR] backend: separate declarations of LB algos from their lookup method
Willy Tarreau [Sat, 3 Oct 2009 10:21:20 +0000 (12:21 +0200)] 
[MINOR] backend: separate declarations of LB algos from their lookup method

LB algo macros were composed of the LB algo by itself without any indication
of the method to use to look up a server (the lb function itself). This
method was implied by the LB algo, which was not very convenient to add
more algorithms. Now we have several fields in the LB macros, some to
describe what to look for in the requests, some to describe how to transform
that (kind of algo) and some to describe what lookup function to use.

The next patch will make it possible to factor out some code for all algos
which rely on a map.

15 years ago[CLEANUP] proxy: move last lb-specific bits to their respective files
Willy Tarreau [Sat, 3 Oct 2009 09:21:53 +0000 (11:21 +0200)] 
[CLEANUP] proxy: move last lb-specific bits to their respective files

The lbprm structure has moved to backend.h, where it should be, and
all algo-specific types and declarations have moved to their specific
files. The proxy struct is now much more readable.

15 years ago[MINOR] Allow dots in show-node & add "white-space: nowrap" in th.pxname.
Krzysztof Piotr Oledzki [Sat, 3 Oct 2009 13:46:08 +0000 (15:46 +0200)] 
[MINOR] Allow dots in show-node & add "white-space: nowrap" in th.pxname.

15 years ago[MINOR] add "description", "node" and show-node"/"show-desc", remove "node-name", v2
Krzysztof Piotr Oledzki [Fri, 2 Oct 2009 20:51:14 +0000 (22:51 +0200)] 
[MINOR] add "description", "node" and show-node"/"show-desc", remove "node-name", v2

This patch implements "description" (proxy and global) and "node" (global)
options, removes "node-name" and adds "show-node" & "show-desc" options
for "stats". It also changes the way the header lines (with proxy name) and
the statistics are displayed, so stats no longer look so clumsy with very
long names.

Instead of "node-name" it is possible to use show-node/show-desc with
an optional parameter that overrides a default node/description.

backend cust-0045
        # report specific values for this customer
        stats show-node Europe
        stats show-desc Master node for Europe, Asia, Africa

15 years ago[MINOR] lb_map: reorder code in order to ease integration of new hash functions
Willy Tarreau [Thu, 1 Oct 2009 19:11:15 +0000 (21:11 +0200)] 
[MINOR] lb_map: reorder code in order to ease integration of new hash functions

We need to remove hash map accesses out of backend.c if we want to
later support new hash methods. This patch separates the hash computation
method from the server lookup. It leaves the lookup function to lb_map.c
and calls it with the result of the hash.

15 years ago[CLEANUP] backend: move LB algos to individual files
Willy Tarreau [Thu, 1 Oct 2009 09:19:37 +0000 (11:19 +0200)] 
[CLEANUP] backend: move LB algos to individual files

It was becoming painful to have all the LB algos in backend.c.
Let's move them to their own files. A few hashing functions still
need be broken in two parts, one for the contents and one for the
map position.

15 years ago[MINOR] include time.h from freq_ctr.h as is uses "now".
Willy Tarreau [Thu, 1 Oct 2009 09:05:26 +0000 (11:05 +0200)] 
[MINOR] include time.h from freq_ctr.h as is uses "now".

15 years ago[MINOR] health checks logging unification
Krzysztof Piotr Oledzki [Sun, 27 Sep 2009 15:28:21 +0000 (17:28 +0200)] 
[MINOR] health checks logging unification

The code was duplicated serveral times, let's use
server_status_printf() instead.

   text    data     bss     dec     hex filename
 263504    5800   64224  333528   516d8 haproxy-old
 262944    5800   64224  332968   514a8 haproxy-new

Depends on "struct chunk rework" and
 "Health check reporting code rework + health logging, v3"

15 years ago[BUG] check if rise/fall has an argument and it is > 0
Krzysztof Piotr Oledzki [Sun, 27 Sep 2009 14:17:31 +0000 (16:17 +0200)] 
[BUG] check if rise/fall has an argument and it is > 0

Check if rise/fall has an argument and it is > 0  or bad things may happen
in the health checks. ;)

Now it is verified and the code no longer allows for such condition:

backend bad
(...)
        server o-f0 192.168.129.27:80 check inter 4000 source 0.0.0.0 rise 0
        server o-r0 192.168.129.27:80 check inter 4000 source 0.0.0.0 fall 0
        server o-f1 192.168.129.27:80 check inter 4000 source 0.0.0.0 rise
        server o-r1 192.168.129.27:80 check inter 4000 source 0.0.0.0 fall

[ALERT] 269/161830 (24136) : parsing [../git/haproxy.cfg:98]: 'rise' has to be > 0.
[ALERT] 269/161830 (24136) : parsing [../git/haproxy.cfg:99]: 'fall' has to be > 0.
[ALERT] 269/161830 (24136) : parsing [../git/haproxy.cfg:100]: 'rise' expects an integer argument.
[ALERT] 269/161830 (24136) : parsing [../git/haproxy.cfg:101]: 'fall' expects an integer argument.

Also add endline in the custom id checking code.

15 years ago[MEDIUM] Health check reporting code rework + health logging, v3
Krzysztof Piotr Oledzki [Sun, 27 Sep 2009 13:50:02 +0000 (15:50 +0200)] 
[MEDIUM] Health check reporting code rework + health logging, v3

This patch adds health logging so it possible to check what
was happening before a crash. Failed healt checks are logged if
server is UP and succeeded healt checks if server is DOWN,
so the amount of additional information is limited.

I also reworked the code a little:

 - check_status_description[] and check_status_info[] is now
   joined into check_statuses[]

 - set_server_check_status updates not only s->check_status and
   s->check_duration but also s->result making the code simpler

Changes in v3:
 - for now calculate and use local versions of health/rise/fall/state,
   it is a slow path, no harm should be done. One day we may centralize
   processing of the checks and remove the duplicated code.
 - also log checks that are restoring current state
 - use "conditionally succeeded" for 404 with disable-on-404

15 years ago[MAJOR] struct chunk rework
Krzysztof Piotr Oledzki [Sun, 27 Sep 2009 11:23:20 +0000 (13:23 +0200)] 
[MAJOR] struct chunk rework

Add size to struct chunk and simplify the code as there is
no longer required to pass sizeof in chunk_printf().

15 years ago[MINOR] backend: uninline some LB functions
Willy Tarreau [Thu, 1 Oct 2009 07:21:55 +0000 (09:21 +0200)] 
[MINOR] backend: uninline some LB functions

There is no reason to inline functions which are used to grab a server
depending on an LB algo. They are large and used at several places.
Uninlining them saves 400 bytes of code.

15 years ago[MINOR] backend: export some functions to recount servers
Willy Tarreau [Thu, 1 Oct 2009 07:17:05 +0000 (09:17 +0200)] 
[MINOR] backend: export some functions to recount servers

Those functions will be used by new LB algorithms.

15 years ago[BUG] http stats: large outputs sometimes got some parts chopped off
Willy Tarreau [Thu, 24 Sep 2009 20:22:18 +0000 (22:22 +0200)] 
[BUG] http stats: large outputs sometimes got some parts chopped off

Due to a misplaced call to stream_int_retnclose(), the stats output
buffer was erased before each call to produce_content(), resulting
in missing pieces in the stats output if the connection was not
fast enough between haproxy and the client.

15 years ago[DOC] add missing rate_lim and rate_max
Krzysztof Piotr Oledzki [Mon, 31 Aug 2009 19:23:27 +0000 (21:23 +0200)] 
[DOC] add missing rate_lim and rate_max

15 years ago[RELEASE] Released version 1.4-dev3 v1.4-dev3
Willy Tarreau [Wed, 23 Sep 2009 22:12:50 +0000 (00:12 +0200)] 
[RELEASE] Released version 1.4-dev3

Released version 1.4-dev3 with the following main changes :
    - [BUILD] compilation of haproxy-1.4-dev2 on FreeBSD
    - [MEDIUM] Collect & show information about last health check, v3
    - [MINOR] export the hostname variable so that all the code can access it
    - [MINOR] stats: add a new node-name setting
    - [MEDIUM] remove old experimental tcpsplice option
    - [BUILD] fix build for systems without SOL_TCP
    - [MEDIUM] move connection establishment from backend to the SI.
    - [MEDIUM] make the global stats socket part of a frontend
    - [MEDIUM] session: account per-listener connections
    - [MINOR] session: switch to established state if no connect function
    - [MEDIUM] make the unix stats sockets use the generic session handler
    - [CLEANUP] unix: remove uxst_process_session()
    - [CLEANUP] move remaining stats sockets code to dumpstats
    - [MINOR] move the initial task's nice value to the listener
    - [MINOR] cleanup set_session_backend by using pre-computed analysers
    - [MINOR] set s->srv_error according to the analysers
    - [MEDIUM] set rep->analysers from fe and be analysers
    - [MEDIUM] replace BUFSIZE with buf->size in computations
    - [MEDIUM] make it possible to change the buffer size in the configuration
    - [MEDIUM] report error on buffer writes larger than buffer size
    - [MEDIUM] stream_interface: add and use ->update function to resync
    - [CLEANUP] remove ifdef MSG_NOSIGNAL and define it instead
    - [MEDIUM] remove TCP_CORK and make use of MSG_MORE instead
    - [BUG] tarpit did not work anymore
    - [MINOR] acl: add support for hdr_ip to match IP addresses in headers
    - [MAJOR] buffers: fix misuse of the BF_SHUTW_NOW flag
    - [MINOR] buffers: provide more functions to handle buffer data
    - [MEDIUM] buffers: provide new buffer_feed*() function
    - [MINOR] buffers: add peekchar and peekline functions for stream interfaces
    - [MINOR] buffers: provide buffer_si_putchar() to send a char from a stream interface
    - [BUG] buffer_forward() would not correctly consider data already scheduled
    - [MINOR] buffers: add buffer_cut_tail() to cut only unsent data
    - [MEDIUM] stream_interface: make use of buffer_cut_tail() to report errors
    - [MAJOR] http: add support for HTTP 1xx informational responses
    - [MINOR] buffers: inline buffer_si_putchar()
    - [MAJOR] buffers: split BF_WRITE_ENA into BF_AUTO_CONNECT and BF_AUTO_CLOSE
    - [MAJOR] buffers: fix the BF_EMPTY flag's meaning
    - [BUG] stream_interface: SI_ST_CLO must have buffers SHUT
    - [MINOR] stream_sock: don't set SI_FL_WAIT_DATA if BF_SHUTW_NOW is set
    - [MEDIUM] add support for infinite forwarding
    - [BUILD] stream_interface: fix conflicting declaration
    - [BUG] buffers: buffer_forward() must not always clear BF_OUT_EMPTY
    - [BUG] variable buffer size ignored at initialization time
    - [MINOR] ensure that buffer_feed() and buffer_skip() set BF_*_PARTIAL
    - [BUG] fix buffer_skip() and buffer_si_getline() to correctly handle wrap-arounds
    - [MINOR] stream_interface: add SI_FL_DONT_WAKE flag
    - [MINOR] stream_interface: add iohandler callback
    - [MINOR] stream_interface: add functions to support running as internal/external tasks
    - [MEDIUM] session: call iohandler for embedded tasks (applets)
    - [MINOR] add a ->private member to the stream_interface
    - [MEDIUM] stats: prepare the connection for closing before dumping
    - [MEDIUM] stats: replace the stats socket analyser with an SI applet

15 years ago[MEDIUM] stats: replace the stats socket analyser with an SI applet
Willy Tarreau [Tue, 22 Sep 2009 17:31:03 +0000 (19:31 +0200)] 
[MEDIUM] stats: replace the stats socket analyser with an SI applet

We can get rid of the stats analyser by moving all the stats code
to a stream interface applet. Above being cleaner, it provides new
advantages such as the ability to process requests and responses
from the same function and work only with simple state machines.
There's no need for any hijack hack anymore.

The direct advantage for the user are the interactive mode and the
ability to chain several commands delimited by a semi-colon. Now if
the user types "prompt", he gets a prompt from which he can send
as many requests as he wants. All outputs are terminated by a
blank line followed by a new prompt, so this can be used from
external tools too.

The code is not very clean, it needs some rework, but some part
of the dirty parts are due to the remnants of the hijack mode used
in the old functions we call.

The old AN_REQ_STATS_SOCK analyser flag is now unused and has been
removed.