]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
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.

15 years ago[MEDIUM] stats: prepare the connection for closing before dumping
Willy Tarreau [Tue, 22 Sep 2009 17:27:35 +0000 (19:27 +0200)] 
[MEDIUM] stats: prepare the connection for closing before dumping

We will need to modify the stats dump functions so that they can
be used in interactive mode. For this, we want their caller to
prepare the connection for a close, not themselves to do it.
Let's simply move the stream_int_retnclose() out.

15 years ago[MINOR] add a ->private member to the stream_interface
Willy Tarreau [Sun, 20 Sep 2009 19:43:50 +0000 (21:43 +0200)] 
[MINOR] add a ->private member to the stream_interface

iohandlers will need to store some form of context and for this will
need a way to find their call context. We add the ->private as well
as ->st0 and ->st1 for that purpose. Most likely ->private will be
initialized to the current session and ->st0 and ->st1 will be used
to maintain any form of internal state between calls.

15 years ago[MEDIUM] session: call iohandler for embedded tasks (applets)
Willy Tarreau [Sat, 5 Sep 2009 18:57:35 +0000 (20:57 +0200)] 
[MEDIUM] session: call iohandler for embedded tasks (applets)

Currently, it's up to process_session() to call the internal tasks
if any are associated to the task being processed. If such a task
is referenced, we don't use ->update() in process_session(), but
only ->iohandler(), which itself is free to use ->update() to
complete its work.

It it also important to understand that an I/O handler may wake the
task up again, for instance because it tries to send data to the
other stream interface, which itself will wake the task up. So
after returning from ->iohandler(), we must check if the task has
been sent back to the runqueue, and if so, immediately return.

15 years ago[MINOR] stream_interface: add functions to support running as internal/external tasks
Willy Tarreau [Sat, 5 Sep 2009 18:57:35 +0000 (20:57 +0200)] 
[MINOR] stream_interface: add functions to support running as internal/external tasks

It will soon be necessary to have stream interfaces running as part of
the current task, or as independant tasks. For instance when we want to
implement compression or SSL. It will also be used for applets running
as stream interfaces.

These new functions are used to perform exactly that. Note that it's
still not easy to write a simple echo applet and more functions will
likely be needed.

15 years ago[MINOR] stream_interface: add iohandler callback
Willy Tarreau [Sat, 5 Sep 2009 18:57:35 +0000 (20:57 +0200)] 
[MINOR] stream_interface: add iohandler callback

When stream interfaces will embedded applets running as part as their
holding task, we'll need a new callback to process them from the
session processor.

15 years ago[MINOR] stream_interface: add SI_FL_DONT_WAKE flag
Willy Tarreau [Sat, 5 Sep 2009 18:57:35 +0000 (20:57 +0200)] 
[MINOR] stream_interface: add SI_FL_DONT_WAKE flag

We had to add a new stream_interface flag : SI_FL_DONT_WAKE. This flag
is used to indicate that a stream interface is being updated and that
no wake up should be sent to its owner. This will be required for tasks
embedded into stream interfaces. Otherwise, we could have the
owner task send wakeups to itself during status updates, thus
preventing the state from converging. As long as a stream_interface's
status is being monitored and adjusted, there is no reason to wake it
up again, as we know its changes will be seen and considered.

15 years ago[BUG] fix buffer_skip() and buffer_si_getline() to correctly handle wrap-arounds
Willy Tarreau [Wed, 23 Sep 2009 20:56:07 +0000 (22:56 +0200)] 
[BUG] fix buffer_skip() and buffer_si_getline() to correctly handle wrap-arounds

Those two functions did not correctly deal with full buffers and/or
buffers that wrapped around. Buffer_skip() was even able to incorrectly
set buf->w further than the end of buffer if its len argument was wrong,
and buffer_si_getline() was able to incorrectly return a length larger
than the effective buffer data available.

15 years ago[MINOR] ensure that buffer_feed() and buffer_skip() set BF_*_PARTIAL
Willy Tarreau [Wed, 23 Sep 2009 21:47:55 +0000 (23:47 +0200)] 
[MINOR] ensure that buffer_feed() and buffer_skip() set BF_*_PARTIAL

It's important that these functions set these flags themselves, otherwise
the callers will always have to do this, and there is no valid reason for
not doing it.

15 years ago[BUG] variable buffer size ignored at initialization time
Willy Tarreau [Wed, 23 Sep 2009 21:37:52 +0000 (23:37 +0200)] 
[BUG] variable buffer size ignored at initialization time

Commit 27a674efb84bde8c045b87c9634f123e2f8925dc introduced the ability
to configure buffer sizes. Unfortunately, the pool was created before
the conf was read, so that is was always set to the default size.

In order to fix that, we delay the call to init_buffer(), which is not
a problem since nothing uses it during the initialization.

15 years ago[MEDIUM] Collect & show information about last health check, v3
Krzysztof Piotr Oledzki [Wed, 23 Sep 2009 20:09:24 +0000 (22:09 +0200)] 
[MEDIUM] Collect & show information about last health check, v3

Collect information about last health check result,
including L7 code if possible (for example http or smtp
return code) and time took to finish last check.

Health check info is provided on both stats pages (html & csv)
and logged when a server is marked UP or DOWN. Currently active
check are marked with an asterisk, but only in html mode.

Currently there are 14 status codes:
  UNK     -> unknown

  INI     -> initializing
  SOCKERR -> socket error

  L4OK    -> check passed on layer 4, no upper layers testing enabled
  L4TOUT  -> layer 1-4 timeout
  L4CON   -> layer 1-4 connection problem, for example "Connection refused"
              (tcp rst) or "No route to host" (icmp)

  L6OK    -> check passed on layer 6
  L6TOUT  -> layer 6 (SSL) timeout
  L6RSP   -> layer 6 invalid response - protocol error

  L7OK    -> check passed on layer 7
  L7OKC   -> check conditionally passed on layer 7, for example
               404 with disable-on-404
  L7TOUT  -> layer 7 (HTTP/SMTP) timeout
  L7RSP   -> layer 7 invalid response - protocol error
  L7STS   -> layer 7 response error, for example HTTP 5xx

15 years ago[BUG] buffers: buffer_forward() must not always clear BF_OUT_EMPTY
Willy Tarreau [Sun, 20 Sep 2009 20:56:25 +0000 (22:56 +0200)] 
[BUG] buffers: buffer_forward() must not always clear BF_OUT_EMPTY

This flag was unconditionally cleared, which is wrong because we
can enable forwarding on an empty buffer.

15 years ago[BUILD] stream_interface: fix conflicting declaration
Willy Tarreau [Sun, 20 Sep 2009 18:14:49 +0000 (20:14 +0200)] 
[BUILD] stream_interface: fix conflicting declaration

stream_int_check_timeouts was declared void while it's an int.

15 years ago[MEDIUM] add support for infinite forwarding
Willy Tarreau [Sun, 20 Sep 2009 10:07:52 +0000 (12:07 +0200)] 
[MEDIUM] add support for infinite forwarding

In TCP, we don't want to forward chunks of data, we want to forward
indefinitely. This patch introduces a special value for the amount
of data to be forwarded. When buffer_forward() is called with
BUF_INFINITE_FORWARD, it configures the buffer to never stop
forwarding until the end.

15 years ago[MINOR] stream_sock: don't set SI_FL_WAIT_DATA if BF_SHUTW_NOW is set
Willy Tarreau [Sun, 20 Sep 2009 09:13:40 +0000 (11:13 +0200)] 
[MINOR] stream_sock: don't set SI_FL_WAIT_DATA if BF_SHUTW_NOW is set

Don't ask for more data when we know we're about to close. This is
harmless but better have it cleaned up.

15 years ago[BUG] stream_interface: SI_ST_CLO must have buffers SHUT
Willy Tarreau [Sun, 20 Sep 2009 06:19:25 +0000 (08:19 +0200)] 
[BUG] stream_interface: SI_ST_CLO must have buffers SHUT

An abort during a connect would go to the SI_ST_CLO state without
the buffers shut. This was causing some sessions to never end if
they would abort before the connect request was initiated. This
bug has been introduced after 1.4-dev2.

The doc has been extended to reflect that too.

15 years ago[MAJOR] buffers: fix the BF_EMPTY flag's meaning
Willy Tarreau [Sun, 20 Sep 2009 06:09:44 +0000 (08:09 +0200)] 
[MAJOR] buffers: fix the BF_EMPTY flag's meaning

The BF_EMPTY flag was once used to indicate an empty buffer. However,
it was used half the time as meaning the buffer is empty for the reader,
and half the time as meaning there is nothing left to send.

"nothing to send" is only indicated by "->send_max=0 && !pipe". Once
we fix this, we discover that the flag is not used anymore. So the
flags has been renamed BF_OUT_EMPTY and means exactly the condition
above, ie, there is nothing to send.

Doing so has allowed us to remove some unused tests for emptiness,
but also to uncover a certain amount of situations where the flag
was not correctly set or tested.

15 years ago[MAJOR] buffers: split BF_WRITE_ENA into BF_AUTO_CONNECT and BF_AUTO_CLOSE
Willy Tarreau [Sat, 19 Sep 2009 19:04:57 +0000 (21:04 +0200)] 
[MAJOR] buffers: split BF_WRITE_ENA into BF_AUTO_CONNECT and BF_AUTO_CLOSE

The BF_WRITE_ENA buffer flag became very complex to deal with, because
it was used to :
  - enable automatic connection
  - enable close forwarding
  - enable data forwarding

The last point was not very true anymore since we introduced ->send_max,
but still the test remained everywhere. This was causing issues such as
impossibility to connect without forwarding data, impossibility to prevent
closing when data was forwarded, etc...

This patch clarifies the situation by getting rid of this multi-purpose
flag and replacing it with :
  - data forwarding based only on ->send_max || ->pipe ;
  - a new BF_AUTO_CONNECT flag to allow automatic connection and only
    that ;
  - ability to perform an automatic connection when ->send_max or ->pipe
    indicate that data is waiting to leave the buffer ;
  - a new BF_AUTO_CLOSE flag to let the producer automatically set the
    BF_SHUTW_NOW flag when it gets a BF_SHUTR.

During this cleanup, it was discovered that some tests were performed
twice, or that the BF_HIJACK flag was still tested, which is not needed
anymore since ->send_max replcaed it. These places have been fixed too.

These cleanups have also revealed a few areas where the other flags
such as BF_EMPTY are not cleanly used. This will be an opportunity for
a second patch.

15 years ago[MINOR] buffers: inline buffer_si_putchar()
Willy Tarreau [Sun, 13 Sep 2009 12:58:00 +0000 (14:58 +0200)] 
[MINOR] buffers: inline buffer_si_putchar()

By inlining this function and slightly reordering it, we can double
the getchar/putchar test throughput, and reduce its footprint by about
40 bytes. Also, it was the only non-inlined char-based function, which
now makes it more consistent this time.

15 years ago[MAJOR] http: add support for HTTP 1xx informational responses
Willy Tarreau [Tue, 15 Sep 2009 19:25:21 +0000 (21:25 +0200)] 
[MAJOR] http: add support for HTTP 1xx informational responses

HTTP supports status codes 100 and 101 to report protocol indications,
which are followed by the requests's response. Till now, haproxy would
only see those responses without parsing subsequent ones. That means
that cookie additions were only performed on 1xx messages for instance,
which does not work since headers must be ignored with 1xx messages.
Also, logs were not terribly useful with the common 100 status code
in response to "Expect: 100-continue" during POST some requests.

This change adds support for such messages. Now haproxy sees them,
forwards them and skips them until it finds a correct response, which
it logs and processes. As an exception, header removal/rewriting still
work on 1xx responses in order to be able to strip out sensible
information that may have accidentely been left by another equipment
(possibly an older haproxy itself). But headers addition are disabled
however.

This change brings the ability to loop on response without data, which
is a starting point to support keepalive. The change is marked as major
as a few fixes had to be performed in the HTTP message parser.

15 years ago[MEDIUM] stream_interface: make use of buffer_cut_tail() to report errors
Willy Tarreau [Tue, 15 Sep 2009 19:23:54 +0000 (21:23 +0200)] 
[MEDIUM] stream_interface: make use of buffer_cut_tail() to report errors

The stream_int_return() function used to call buffer_erase() on the response
buffer, which completely wipes it without taking care about whatever could
have been there. Now we more carefully strip only data not scheduled to be
sent.

15 years ago[MINOR] buffers: add buffer_cut_tail() to cut only unsent data
Willy Tarreau [Tue, 15 Sep 2009 19:22:24 +0000 (21:22 +0200)] 
[MINOR] buffers: add buffer_cut_tail() to cut only unsent data

This function is used to cut the "tail" of a buffer, which means strip it
to the length of unsent data only, and kill any remaining unsent data. Any
scheduled forwarding is stopped. This is mainly to be used to send error
messages after existing data. It does the same as buffer_erase() for buffers
without pending outgoing data.

15 years ago[BUG] buffer_forward() would not correctly consider data already scheduled
Willy Tarreau [Tue, 15 Sep 2009 18:32:30 +0000 (20:32 +0200)] 
[BUG] buffer_forward() would not correctly consider data already scheduled

The computations in buffer_forward() were only valid if buffer_forward()
was used on a buffer which had no more data scheduled for forwarding.
This is always the case right now so this bug is not yet triggered but
it will soon be. Now we correctly discount the bytes to be forwarded
from the data already present in the buffer.

15 years ago[MINOR] buffers: provide buffer_si_putchar() to send a char from a stream interface
Willy Tarreau [Thu, 3 Sep 2009 05:13:50 +0000 (07:13 +0200)] 
[MINOR] buffers: provide buffer_si_putchar() to send a char from a stream interface

This function works like a traditional putchar() except that it
can return 0 if the output buffer is full.

Now a basic character-based echo function would look like this, from
a stream interface :

while (1) {
c = buffer_si_peekchar(req);
if (c < 0)
break;
if (!buffer_si_putchar(res, c)) {
si->flags |= SI_FL_WAIT_ROOM;
break;
}
buffer_skip(req, 1);
req->flags |= BF_WRITE_PARTIAL;
res->flags |= BF_READ_PARTIAL;
}

15 years ago[MINOR] buffers: add peekchar and peekline functions for stream interfaces
Willy Tarreau [Tue, 1 Sep 2009 04:41:32 +0000 (06:41 +0200)] 
[MINOR] buffers: add peekchar and peekline functions for stream interfaces

The buffer_si_peekline() function is sort of a fgets() to be used from a
stream interface. It returns a complete line whenever possible, and does
not update the buffer's pointer, so that the reader is free to consume
what it wants to.

buffer_si_peekchar() only returns one character, and also needs a call
to buffer_skip() once the character is definitely consumed.

15 years ago[MEDIUM] buffers: provide new buffer_feed*() function
Willy Tarreau [Mon, 31 Aug 2009 06:09:57 +0000 (08:09 +0200)] 
[MEDIUM] buffers: provide new buffer_feed*() function

This functions act like their buffer_write*() counter-parts,
except that they're specifically designed to be used from a
stream interface handler, as they carefully check size limits
and automatically advance the read pointer depending on the
to_forward attribute.

buffer_feed_chunk() is an inline calling buffer_feed() as both
are the sames. For this reason, buffer_write_chunk() has also
been turned into an inline which calls buffer_write().

15 years ago[MINOR] buffers: provide more functions to handle buffer data
Willy Tarreau [Mon, 31 Aug 2009 05:37:22 +0000 (07:37 +0200)] 
[MINOR] buffers: provide more functions to handle buffer data

buffer_contig_space(), buffer_contig_data() and buffer_skip()
provide easy methods to extract/insert data from/into a buffer.

buffer_write() and buffer_write_chunk() currently do not check
max_len nor to_forward, so they will quickly become embarrassing
to use or will need an equivalent. The reason is that they are
used to build error messages which currently are not subject to
analysis.

15 years ago[MAJOR] buffers: fix misuse of the BF_SHUTW_NOW flag
Willy Tarreau [Sun, 6 Sep 2009 19:37:23 +0000 (21:37 +0200)] 
[MAJOR] buffers: fix misuse of the BF_SHUTW_NOW flag

This flag was incorrectly used as meaning "close immediately",
while it needs to say "close ASAP". ASAP here means when unsent
data pending in the buffer are sent. This helps cleaning up some
dirty tricks where the buffer output was checking the BF_SHUTR
flag combined with EMPTY and other such things. Now we have a
clearly defined semantics :

  - producer sets SHUTR and *may* set SHUTW_NOW if WRITE_ENA is
    set, otherwise leave it to the session processor to set it.
  - consumer only checks SHUTW_NOW to decide whether or not to
    call shutw().

This also induced very minor changes at some locations which were
not protected against buffer changes while the SHUTW_NOW flag was
set. Now we prevent send_max from changing when the flag is set.

Several tests have been run without any unexpected behaviour detected.

Some more cleanups are needed, as it clearly appears that some tests
could be removed with stricter semantics.

15 years ago[MINOR] acl: add support for hdr_ip to match IP addresses in headers
Willy Tarreau [Sat, 19 Sep 2009 05:54:16 +0000 (07:54 +0200)] 
[MINOR] acl: add support for hdr_ip to match IP addresses in headers

For x-forwarded-for and such headers, it's sometimes needed to match
based on network addresses. Let's use hdr_ip() for that.

15 years ago[BUG] tarpit did not work anymore
Willy Tarreau [Sun, 30 Aug 2009 22:17:18 +0000 (00:17 +0200)] 
[BUG] tarpit did not work anymore

Tarpit was broken by recent splitting of analysers. It would still
let the connection go to the server due to a missing buffer_write_dis().
Also, it was performed too late (after content switching rules).

15 years ago[BUILD] compilation of haproxy-1.4-dev2 on FreeBSD
Dmitry Sivachenko [Mon, 24 Aug 2009 11:11:06 +0000 (15:11 +0400)] 
[BUILD] compilation of haproxy-1.4-dev2 on FreeBSD

Please consider the following patches. They are required to
compile haproxy-1.4-dev2 on FreeBSD.

Summary:
1) include <sys/types.h> before <netinet/tcp.h>
2) Use IPPROTO_TCP instead of SOL_TCP
(they are both defined as 6, TCP protocol number)

15 years ago[MEDIUM] remove TCP_CORK and make use of MSG_MORE instead
Willy Tarreau [Wed, 19 Aug 2009 09:14:11 +0000 (11:14 +0200)] 
[MEDIUM] remove TCP_CORK and make use of MSG_MORE instead

send() supports the MSG_MORE flag on Linux, which does the same
as TCP_CORK except that we don't have to remove TCP_NODELAY before
and we don't need any syscall to set/remove it. This can save up
to 4 syscalls around a send() (two for setting it, two for removing
it), and it's much cleaner since it is not persistent. So make use
of it instead.

15 years ago[CLEANUP] remove ifdef MSG_NOSIGNAL and define it instead
Willy Tarreau [Wed, 19 Aug 2009 09:22:33 +0000 (11:22 +0200)] 
[CLEANUP] remove ifdef MSG_NOSIGNAL and define it instead

ifdefs are really annoying in the code. Define MSG_NOSIGNAL to zero
when undefined and remove associated ifdefs.

15 years ago[MEDIUM] stream_interface: add and use ->update function to resync
Willy Tarreau [Tue, 18 Aug 2009 05:38:19 +0000 (07:38 +0200)] 
[MEDIUM] stream_interface: add and use ->update function to resync

We used to call stream_sock_data_finish() directly at the end of
a session update, but if we want to support non-socket interfaces,
we need to have this function configurable. Now we access it via
->update().

15 years ago[MEDIUM] report error on buffer writes larger than buffer size
Willy Tarreau [Tue, 18 Aug 2009 05:19:39 +0000 (07:19 +0200)] 
[MEDIUM] report error on buffer writes larger than buffer size

Since it's now possible to change the buffer size by configuration,
we have to take special measures against writes that are larger than
the buffer size. Before this patch, the writers would indefinitely
block, waiting for some space to free up.

With this patch, the functions simply reject the data with an
appropriate code so that the writers can either detect and process
the error or go on, but never remain blocked.

This has been tested on the stats page which does no longer hang
with buffer sizes smaller than 2.5 kB (256 bytes is even OK for
the CSV version).

15 years ago[MEDIUM] make it possible to change the buffer size in the configuration
Willy Tarreau [Mon, 17 Aug 2009 05:23:33 +0000 (07:23 +0200)] 
[MEDIUM] make it possible to change the buffer size in the configuration

The new tune.bufsize and tune.maxrewrite global directives allow one to
change the buffer size and the maxrewrite size. Right now, setting bufsize
too low will block stats sockets which will not be able to write at all.
An error checking must be added to buffer_write_chunk() so that if it
cannot write its message to an empty buffer, it causes the caller to abort.

15 years ago[MEDIUM] replace BUFSIZE with buf->size in computations
Willy Tarreau [Sun, 16 Aug 2009 21:27:46 +0000 (23:27 +0200)] 
[MEDIUM] replace BUFSIZE with buf->size in computations

The first step towards dynamic buffer size consists in removing
all static definitions of the buffer size. Instead, we store a
buffer's size in itself. Right now they're all preinitialized
to BUFSIZE, but we will change that.

15 years ago[MEDIUM] set rep->analysers from fe and be analysers
Willy Tarreau [Sun, 16 Aug 2009 20:57:50 +0000 (22:57 +0200)] 
[MEDIUM] set rep->analysers from fe and be analysers

sess_establish() used to resort to protocol-specific guesses
in order to set rep->analysers. This is no longer needed as it
gets set from the frontend and the backend as a copy of what
was defined in the configuration.

15 years ago[MINOR] set s->srv_error according to the analysers
Willy Tarreau [Sun, 16 Aug 2009 20:45:38 +0000 (22:45 +0200)] 
[MINOR] set s->srv_error according to the analysers

s->srv_error was set depending on the frontend's protocol. Now it is
set by the HTTP analyser, so that even when switching from a TCP
frontend to an HTTP backend, we can have HTTP error messages.

15 years ago[MINOR] cleanup set_session_backend by using pre-computed analysers
Willy Tarreau [Sun, 16 Aug 2009 20:37:44 +0000 (22:37 +0200)] 
[MINOR] cleanup set_session_backend by using pre-computed analysers

Analyser bitmaps are now stored in the frontend and backend, and
combined at configuration time. That way, set_session_backend()
does not need to perform any protocol-specific combinations.

15 years ago[MINOR] move the initial task's nice value to the listener
Willy Tarreau [Sun, 16 Aug 2009 17:12:36 +0000 (19:12 +0200)] 
[MINOR] move the initial task's nice value to the listener

Since the listener is the one indicating what analyser and session
handlers to call, it makes sense that it also sets the task's nice
value. This also helps getting rid of the last trace of the stats
in the proto_uxst file.

15 years ago[CLEANUP] move remaining stats sockets code to dumpstats
Willy Tarreau [Sun, 16 Aug 2009 17:06:42 +0000 (19:06 +0200)] 
[CLEANUP] move remaining stats sockets code to dumpstats

The remains of the stats socket code has nothing to do in proto_uxst
anymore and must move to dumpstats. The code is much cleaner and more
structured. It was also an opportunity to rename AN_REQ_UNIX_STATS
as AN_REQ_STATS_SOCK as the stats socket is no longer unix-specific
either.

The last item refering to stats in proto_uxst is the setting of the
task's nice value which should in fact come from the listener.

15 years ago[CLEANUP] unix: remove uxst_process_session()
Willy Tarreau [Sun, 16 Aug 2009 16:54:47 +0000 (18:54 +0200)] 
[CLEANUP] unix: remove uxst_process_session()

This one is not used anymore.

15 years ago[MEDIUM] make the unix stats sockets use the generic session handler
Willy Tarreau [Sun, 16 Aug 2009 16:51:29 +0000 (18:51 +0200)] 
[MEDIUM] make the unix stats sockets use the generic session handler

process_session() is now ready to handle unix stats sockets. This
first step works and old code has not been removed. A cleanup is
required. The stats handler is not unix socket-centric anymore and
should move to dumpstats.c.

15 years ago[MINOR] session: switch to established state if no connect function
Willy Tarreau [Sun, 16 Aug 2009 16:27:24 +0000 (18:27 +0200)] 
[MINOR] session: switch to established state if no connect function

When a stream interface has no connect() function, it means it is
immediately connected, so we don't need any connection request.
This will be used with unix sockets.

15 years ago[MEDIUM] session: account per-listener connections
Willy Tarreau [Sun, 16 Aug 2009 16:20:44 +0000 (18:20 +0200)] 
[MEDIUM] session: account per-listener connections

In order to merge the unix session handling code, we have to maintain
the number of per-listener connections in the session. This was only
performed for unix sockets till now.

15 years ago[MEDIUM] make the global stats socket part of a frontend
Willy Tarreau [Sun, 16 Aug 2009 15:41:45 +0000 (17:41 +0200)] 
[MEDIUM] make the global stats socket part of a frontend

Creating a frontend for the global stats socket will help merge
unix sockets management with the other socket management. Since
frontends are huge structs, we only allocate it if required.

15 years ago[MEDIUM] move connection establishment from backend to the SI.
Willy Tarreau [Sun, 16 Aug 2009 12:02:45 +0000 (14:02 +0200)] 
[MEDIUM] move connection establishment from backend to the SI.

The connection establishment was completely handled by backend.c which
normally just handles LB algos. Since it's purely TCP, it must move to
proto_tcp.c. Also, instead of calling it directly, we now call it via
the stream interface, which will later help us unify session handling.

15 years ago[BUILD] fix build for systems without SOL_TCP
Willy Tarreau [Sun, 16 Aug 2009 12:13:47 +0000 (14:13 +0200)] 
[BUILD] fix build for systems without SOL_TCP

Andrew Azarov reported that haproxy-1.4-dev1 does not build
under FreeBSD 7.2 because SOL_TCP is not defined. So add a
check for its definition before using it. This only impacts
network optimisations anyway.

15 years ago[MEDIUM] remove old experimental tcpsplice option
Willy Tarreau [Sun, 16 Aug 2009 11:20:32 +0000 (13:20 +0200)] 
[MEDIUM] remove old experimental tcpsplice option

This Linux-specific option was never really used in production and
has since been superseded by new splicing options brought by recent
Linux kernels.

It caused several particular cases in the code because the kernel
would take care of the session without haproxy being able to do
anything on it, which became hard to handle in the new architecture.

Let's simply get rid of it now that there is a replacement available.

15 years ago[MINOR] stats: add a new node-name setting
Willy Tarreau [Sun, 16 Aug 2009 08:29:18 +0000 (10:29 +0200)] 
[MINOR] stats: add a new node-name setting

The new "node-name" stats setting enables reporting of a node ID on
the stats page. It is possible to return the system's host name as
well as a specific name.

15 years ago[MINOR] export the hostname variable so that all the code can access it
Willy Tarreau [Sun, 16 Aug 2009 08:08:02 +0000 (10:08 +0200)] 
[MINOR] export the hostname variable so that all the code can access it

The hostname variable will be used later, export it.

15 years ago[RELEASE] Released version 1.4-dev2 v1.4-dev2
Willy Tarreau [Sun, 9 Aug 2009 20:57:09 +0000 (22:57 +0200)] 
[RELEASE] Released version 1.4-dev2

Released version 1.4-dev2 with the following main changes :
    - [BUG] task: fix possible crash when some timeouts are not configured
    - [BUG] log: option tcplog would log to global if no logger was defined