]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
3 years agoBUG/MINOR: ssl_ckch: Dump cert transaction only once if show command yield
Christopher Faulet [Fri, 3 Jun 2022 08:46:40 +0000 (10:46 +0200)] 
BUG/MINOR: ssl_ckch: Dump cert transaction only once if show command yield

When loaded SSL certificates are displayed via "show ssl cert" command, the
in-progess transaction, if any, is also displayed. However, if the command
yield, the transaction is re-displayed again and again.

To fix the issue, old_ckchs field is used to remember the transaction was
already displayed.

This patch must be backported as far as 2.2.

3 years agoBUG/MINOR: ssl_ckch: Dump CA transaction only once if show command yield
Christopher Faulet [Fri, 3 Jun 2022 08:42:48 +0000 (10:42 +0200)] 
BUG/MINOR: ssl_ckch: Dump CA transaction only once if show command yield

When loaded CA files are displayed via "show ssl ca-file" command, the
in-progress transaction, if any, is also displayed. However, if the command
yield, the transaction is re-displayed again and again.

To fix the issue, old_cafile_entry field is used to remember the transaction
was already displayed.

This patch must be backported as far as 2.5.

3 years agoBUG/MINOR: ssl_ckch: Dump CRL transaction only once if show command yield
Christopher Faulet [Fri, 3 Jun 2022 08:32:18 +0000 (10:32 +0200)] 
BUG/MINOR: ssl_ckch: Dump CRL transaction only once if show command yield

When loaded CRL files are displayed via "show ssl crl-file" command, the
in-progess transaction, if any, is also displayed. However, if the command
yield, the transaction is re-displayed again and again.

To fix the issue, old_crlfile_entry field is used to remember the transaction
was already displayed.

This patch must be backported as far as 2.5.

3 years agoBUG/MINOR: ssl_ckch: Use right type for old entry in show_crlfile_ctx
Christopher Faulet [Fri, 3 Jun 2022 08:21:27 +0000 (10:21 +0200)] 
BUG/MINOR: ssl_ckch: Use right type for old entry in show_crlfile_ctx

Because of a typo (I guess), an unknown type is used for the old entry in
show_crlfile_ctx structure. Because this field is unused, there is no
compilation error. But it must be a cafile_entry and not a crlfile_entry.

Note this field is not used for now, but it will be used.

This patch must be backported to 2.6.

3 years agoMINOR: ssl_ckch: Simplify I/O handler to commit changes on CA/CRL entry
Christopher Faulet [Fri, 3 Jun 2022 07:00:09 +0000 (09:00 +0200)] 
MINOR: ssl_ckch: Simplify I/O handler to commit changes on CA/CRL entry

Simplify cli_io_handler_commit_cafile_crlfile() handler function by
retrieving old and new entries at the beginning. In addition the path is
also retrieved at this stage. This removes several switch statements.

Note that the ctx was already validated by the corresponding parsing
function. Thus there is no reason to test the pointers.

While it is not a bug, this patch may help to fix issue #1731.

3 years agoCLEANUP: ssl_ckch: Use corresponding enum for commit_cacrlfile_ctx.cafile_type
Christopher Faulet [Fri, 3 Jun 2022 07:17:09 +0000 (09:17 +0200)] 
CLEANUP: ssl_ckch: Use corresponding enum for commit_cacrlfile_ctx.cafile_type

There is an enum to determine the entry entry type when changes are
committed on a CA/CRL entry. So use it in the service context instead of an
integer.

This patch may help to fix issue #1731.

3 years agoREGTESTS: http_request_buffer: Increase client timeout to wait "slow" clients
Christopher Faulet [Thu, 2 Jun 2022 12:01:30 +0000 (14:01 +0200)] 
REGTESTS: http_request_buffer: Increase client timeout to wait "slow" clients

The default client timeout is too small to be sure to always wait end of
slow clients (the last 2 clients use a delay to send their request). But it
cannot be increased because it will slow down the regtest execution. So a
dedicated frontend with a higher client timeout has been added. This
frontend is used by "slow" clients. The other one is used for normal
requests.

3 years agoREGTESTS: abortonclose: Add a barrier to not mix up log messages
Christopher Faulet [Thu, 2 Jun 2022 11:56:00 +0000 (13:56 +0200)] 
REGTESTS: abortonclose: Add a barrier to not mix up log messages

Depending on the timing, time to time, the log message for "/c4" request can
be received before the one for "/c2" request. To (hopefully) fix the issue,
a barrier has been added to wait "/c2" log message before sending other
requests.

3 years agoCLEANUP: Re-apply xalloc_size.cocci (2)
Tim Duesterhus [Wed, 1 Jun 2022 19:58:37 +0000 (21:58 +0200)] 
CLEANUP: Re-apply xalloc_size.cocci (2)

This reapplies the xalloc_size.cocci patch across the whole `src/` tree.

see 16cc16dd8235e7eb6c38b7abd210bd1e1d96b1d9
see 63ee0e4c01b94aee5fc6c6dd98cfc4480ae5ea46

3 years agoMEDIUM: http-ana: Always report rewrite failures as PRXCOND in logs
Christopher Faulet [Wed, 1 Jun 2022 15:42:35 +0000 (17:42 +0200)] 
MEDIUM: http-ana: Always report rewrite failures as PRXCOND in logs

Rewrite failures in http rules are reported as proxy errors (PRXCOND) in
logs. However, other rewrite errors are reported as internal errors. For
instance, it happens when we fail to add X-Forwarded-For header. It is not
consistent and it is confusing. So now, all rewite failures are reported as
proxy errors.

This patch may be backported if necessary.

3 years agoMEDIUM: httpclient: Don't close CLI applet at the end of a response
Christopher Faulet [Wed, 1 Jun 2022 15:17:24 +0000 (17:17 +0200)] 
MEDIUM: httpclient: Don't close CLI applet at the end of a response

There is no reason to close the CLI applet when the whole response was
dumped. This prevent anyone to use the CLI in interactive mode.

3 years agoBUG/MEDIUM: httpclient: Rework CLI I/O handler to handle full buffer cases
Christopher Faulet [Wed, 1 Jun 2022 15:08:19 +0000 (17:08 +0200)] 
BUG/MEDIUM: httpclient: Rework CLI I/O handler to handle full buffer cases

'httpclient' command does not properly handle full buffer cases. When the
response buffer is full, we exit to retry later. However, the context flags
are updated. It means when this happens, we may loose a part of the
response.

So now, flags are preserved when we fail to push data into the response
buffer. In addition, instead of dumping one part per call, we now try to
dump as much data as possible.

Finally, when there is no more data, because everything was dumped or
because we are waiting for more data from the HTTP client, the applet is
updated accordingly by calling applet_have_no_more_data(). Otherwise, when
some data are blocked, applet_putchk() already takes care to update the SE
flags. So, it is useless to call sc_need_room().

This patch should fix the issue #1723. It must be backported as far as
2.5. But a massive refactoring was performed in 2.6. So, for the 2.5 and
below, the patch will have to be adapted.

3 years agoBUG/MEDIUM: httpclient: Don't remove HTX header blocks before duplicating them
Christopher Faulet [Wed, 1 Jun 2022 14:37:49 +0000 (16:37 +0200)] 
BUG/MEDIUM: httpclient: Don't remove HTX header blocks before duplicating them

Commit 534645d6 ("BUG/MEDIUM: httpclient: Fix loop consuming HTX blocks from
the response channel") introduced a regression. When the response is
consumed, The HTX header blocks are removed before duplicating them. Thus,
the first header block is always lost.

This patch must be backported as far as 2.5.

3 years agoBUG/MEDIUM: ssl/crt-list: Rework 'add ssl crt-list' to handle full buffer cases
Christopher Faulet [Wed, 1 Jun 2022 14:31:09 +0000 (16:31 +0200)] 
BUG/MEDIUM: ssl/crt-list: Rework 'add ssl crt-list' to handle full buffer cases

'add ssl crt-list' command is also concerned. This patch is similar to the
previous ones. Full buffer cases when we try to push the reply are not
properly handled. To fix the issue, the functions responsible to add a
crt-list entry were reworked.

First, the error message is now part of the service context. This way, if we
cannot push the error message in the reponse buffer, we may retry later. To
do so, a dedicated state was created (ADDCRT_ST_ERROR,). Then, the success
message is also handled in a dedicated state (ADDCRT_ST_SUCCESS). This way
we are able to retry to push it if necessary. Finally, the dot displayed for
each new instance is now immediatly pushed in the response buffer, and
before the update. This way, we are able to retry too if necessary.

This patch should fix the issue #1724. It must be backported as far as
2.2. But a massive refactoring was performed in 2.6. So, for the 2.5 and
below, the patch will have to be adapted.

3 years agoBUG/MEDIUM: ssl_ckch: Rework 'commit ssl ca-file' to handle full buffer cases
Christopher Faulet [Tue, 31 May 2022 15:51:06 +0000 (17:51 +0200)] 
BUG/MEDIUM: ssl_ckch: Rework 'commit ssl ca-file' to handle full buffer cases

'commit ssl crl-file' command is also concerned. This patch is similar to
the previous one. Full buffer cases when we try to push the reply are not
properly handled. To fix the issue, the functions responsible to commit CA
or CRL entry changes were reworked.

First, the error message is now part of the service context. This way, if we
cannot push the error message in the reponse buffer, we may retry later. To
do so, a dedicated state was created (CACRL_ST_ERROR). Then, the success
message is also handled in a dedicated state (CACRL_ST_SUCCESS). This way we
are able to retry to push it if necessary. Finally, the dot displayed for
each updated CKCH instance is now immediatly pushed in the response buffer,
and before the update. This way, we are able to retry too if necessary.

This patch should fix the issue #1722. It must be backported as far as
2.5. But a massive refactoring was performed in 2.6. So, for the 2.5, the
patch will have to be adapted.

3 years agoBUG/MEDIUM: ssl_ckch: Rework 'commit ssl cert' to handle full buffer cases
Christopher Faulet [Tue, 31 May 2022 14:37:01 +0000 (16:37 +0200)] 
BUG/MEDIUM: ssl_ckch: Rework 'commit ssl cert' to handle full buffer cases

When changes on a certificate are commited, a trash buffer is used to create
the response. Once done, the message is copied in the response buffer.
However, if the buffer is full, there is no way to retry and the message is
lost. The same issue may happen with the error message. It is a design issue
of cli_io_handler_commit_cert() function.

To fix it, the function was reworked. First, the error message is now part
of the service context. This way, if we cannot push the error message in the
reponse buffer, we may retry later. To do so, a dedicated state was created
(CERT_ST_ERROR). Then, the success message is also handled in a dedicated
state (CERT_ST_SUCCESS). This way we are able to retry to push it if
necessary. Finally, the dot displayed for each updated CKCH instance is now
immediatly pushed in the response buffer, and before the update. This way,
we are able to retry too if necessary.

This patch should fix the issue #1725. It must be backported as far as
2.2. But massive refactoring was performed in 2.6. So, for the 2.5 and
below, the patch must be adapted.

3 years agoBUG/MINOR: ssl_ckch: Don't duplicate path when replacing a CA/CRL entry
Christopher Faulet [Tue, 31 May 2022 16:10:19 +0000 (18:10 +0200)] 
BUG/MINOR: ssl_ckch: Don't duplicate path when replacing a CA/CRL entry

When a CA or CRL entry is replaced (via 'set ssl ca-file' or 'set ssl
crl-file' commands), the path is duplicated and used to identify the ongoing
transaction. However, if the same command is repeated, the path is still
duplicated but the transaction is not changed and the duplicated path is not
released. Thus there is a memory leak.

By reviewing the code, it appears there is no reason to duplicate the
path. It is always the filename path of the old entry. So, a reference on it
is now used. This simplifies the code and this fixes the memory leak.

This patch must be backported as far as 2.5.

3 years agoBUG/MINOR: ssl_ckch: Don't duplicate path when replacing a cert entry
Christopher Faulet [Tue, 31 May 2022 16:07:59 +0000 (18:07 +0200)] 
BUG/MINOR: ssl_ckch: Don't duplicate path when replacing a cert entry

When a certificate entry is replaced (via 'set ssl cert' command), the path
is duplicated and used to identify the ongoing transaction. However, if the
same command is repeated, the path is still duplicated but the transaction
is not changed and the duplicated path is not released. Thus there is a
memory leak.

By reviewing the code, it appears there is no reason to duplicate the
path. It is always the path of the old entry. So, a reference on it is now
used. This simplifies the code and this fixes the memory leak.

This patch must be backported as far as 2.2.

3 years agoBUG/MEDIUM: ssl_ckch: Don't delete CA/CRL entry if it is being modified
Christopher Faulet [Tue, 31 May 2022 16:06:30 +0000 (18:06 +0200)] 
BUG/MEDIUM: ssl_ckch: Don't delete CA/CRL entry if it is being modified

When a CA or a CRL entry is being modified, we must take care to no delete
it because the corresponding ongoing transaction still references it. If we
do so, it leads to a null-deref and a crash may be exeperienced if changes
are commited.

This patch must be backported as far as 2.5.

3 years agoBUG/MEDIUM: ssl_ckch: Don't delete a cert entry if it is being modified
Christopher Faulet [Tue, 31 May 2022 16:04:25 +0000 (18:04 +0200)] 
BUG/MEDIUM: ssl_ckch: Don't delete a cert entry if it is being modified

When a certificate entry is being modified, we must take care to no delete
it because the corresponding ongoing transaction still references it. If we
do so, it leads to a null-deref and a crash may be exeperienced if changes
are commited.

This patch must be backported as far as 2.2.

3 years agoBUG/MINOR: ssl_ckch: Free error msg if commit changes on a CA/CRL entry fails
Christopher Faulet [Tue, 31 May 2022 16:03:26 +0000 (18:03 +0200)] 
BUG/MINOR: ssl_ckch: Free error msg if commit changes on a CA/CRL entry fails

On the CLI, If we fail to commit changes on a CA or a CRL entry, an error
message is returned. This error must be released.

This patch must be backported as far as 2.4.

3 years agoBUG/MINOR: ssl_ckch: Free error msg if commit changes on a cert entry fails
Christopher Faulet [Tue, 31 May 2022 16:02:30 +0000 (18:02 +0200)] 
BUG/MINOR: ssl_ckch: Free error msg if commit changes on a cert entry fails

On the CLI, If we fail to commit changes on a certificate entry, an error
message is returned. This error must be released.

This patch must be backported as far as 2.2.

3 years ago[RELEASE] Released version 2.7-dev0 v2.7-dev0
Willy Tarreau [Tue, 31 May 2022 15:05:27 +0000 (17:05 +0200)] 
[RELEASE] Released version 2.7-dev0

Released version 2.7-dev0 with the following main changes :
    - MINOR: version: it's development again

3 years agoMINOR: version: it's development again
Willy Tarreau [Tue, 31 May 2022 15:04:45 +0000 (17:04 +0200)] 
MINOR: version: it's development again

This essentially reverts b2c1e081f7f61d16697a6c6d8312062baf291eb6.

3 years ago[RELEASE] Released version 2.6.0 v2.6.0
Willy Tarreau [Tue, 31 May 2022 14:58:21 +0000 (16:58 +0200)] 
[RELEASE] Released version 2.6.0

Released version 2.6.0 with the following main changes :
    - DOC: Fix formatting in configuration.txt to fix dconv
    - CLEANUP: tcpcheck: Remove useless test on the stream-connector in tcpcheck_main
    - CLEANUP: muxes: Consider stream's sd as defined in .show_fd callback functions
    - MINOR: quic: Ignore out of packet padding.
    - CLEANUP: quic: Useless QUIC_CONN_TX_BUF_SZ definition
    - CLEANUP: quic: No more used handshake output buffer
    - MINOR: quic: QUIC transport parameters split.
    - MINOR: quic: Transport parameters dump
    - DOC: quic: Update documentation for QUIC Retry
    - MINOR: quic: Tunable "max_idle_timeout" transport parameter
    - MINOR: quic: Tunable "initial_max_streams_bidi" transport parameter
    - MINOR: quic: Clarifications about transport parameters value
    - MINOIR: quic_stats: add QUIC connection errors counters
    - BUG/MINOR: quic: Largest RX packet numbers mixing
    - MINOR: quic_stats: Add transport new counters (lost, stateless reset, drop)
    - DOC: quic: Documentation update for QUIC
    - MINOR: quic: Connection TX buffer setting renaming.
    - MINOR: h3: Add a statistics module for h3
    - MINOR: quic: Send STOP_SENDING frames if mux is released
    - MINOR: quic: Do not drop packets with RESET_STREAM frames
    - BUG/MINOR: qpack: fix buffer API usage on prefix integer encoding
    - BUG/MINOR: qpack: support bigger prefix-integer encoding
    - BUG/MINOR: h3: do not report bug on unknown method
    - SCRIPTS: add make-releases-json to recreate a releases.json file in download dirs
    - SCRIPTS: make publish-release try to launch make-releases-json
    - MINOR: htx: add an unchecked version of htx_get_head_blk()
    - BUILD: htx: use the unchecked version of htx_get_head_blk() where needed
    - BUILD: quic: use inttypes.h instead of stdint.h
    - DOC: internal: remove totally outdated diagrams
    - DOC: remove the outdated ROADMAP file
    - DOC: add maintainers for QUIC and HTTP/3
    - MINOR: h3: define h3 trace module
    - MINOR: h3: add traces on frame recv
    - MINOR: h3: add traces on frame send
    - MINOR: h3: add traces on h3s init/end
    - EXAMPLES: remove completely outdated acl-content-sw.cfg
    - BUILD: makefile: reorder objects by build time
    - DOC: fix a few spelling mistakes in the docs
    - BUG/MEDIUM: peers/cli: fix "show peers" crash
    - CLEANUP: peers/cli: stop misusing the appctx local variable
    - CLEANUP: peers/cli: make peers_dump_peer() take an appctx instead of an stconn
    - BUG/MINOR: peers: set the proxy's name to the peers section name
    - MINOR: server: indicate when no address was expected for a server
    - BUG/MINOR: peers: detect and warn on init_addr/resolvers/check/agent-check
    - DOC: peers: indicate that some server settings are not usable
    - DOC: peers: clarify when entry expiration date is renewed.
    - DOC: peers: fix port number and addresses on new peers section format
    - DOC: gpc/gpt: add commments of gpc/gpt array definitions on stick tables.
    - DOC: install: update supported OpenSSL versions in the INSTALL doc
    - MINOR: ncbuf: adjust ncb_data with NCBUF_NULL
    - BUG/MINOR: h3: fix frame demuxing
    - BUG/MEDIUM: h3: fix H3_EXCESSIVE_LOAD when receiving H3 frame header only
    - BUG/MINOR: quic: Fix QUIC_EV_CONN_PRSAFRM event traces
    - CLEANUP: quic: remove useless check on local UNI stream reception
    - BUG/MINOR: qpack: do not consider empty enc/dec stream as error
    - DOC: intro: adjust the numbering of paragrams to keep the output ordered
    - MINOR: version: mention that it's LTS now.

3 years agoMINOR: version: mention that it's LTS now.
Willy Tarreau [Tue, 31 May 2022 14:53:13 +0000 (16:53 +0200)] 
MINOR: version: mention that it's LTS now.

The version will be maintained up to around Q2 2027. Let's
also update the INSTALL file to mention this.

3 years agoDOC: intro: adjust the numbering of paragrams to keep the output ordered
Willy Tarreau [Tue, 31 May 2022 14:23:06 +0000 (16:23 +0200)] 
DOC: intro: adjust the numbering of paragrams to keep the output ordered

The HTML version appeared with sections in a different order where
3.3.10..3.3.16 were placed between 3.3.1 and 3.3.2. This patch just slips
them into an intermediary section so that we now have "basic features",
"standard features", and "advanced features".

3 years agoBUG/MINOR: qpack: do not consider empty enc/dec stream as error
Amaury Denoyelle [Tue, 31 May 2022 13:21:27 +0000 (15:21 +0200)] 
BUG/MINOR: qpack: do not consider empty enc/dec stream as error

When parsing QPACK encoder/decoder streams, h3_decode_qcs() displays an
error trace if they are empty. Change the return code used in QPACK code
to avoid this trace.

To uniformize with MUX/H3 code, 0 is now used to indicate success.

Beyond this spurious error trace, this bug has no impact.

3 years agoCLEANUP: quic: remove useless check on local UNI stream reception
Amaury Denoyelle [Tue, 31 May 2022 13:17:02 +0000 (15:17 +0200)] 
CLEANUP: quic: remove useless check on local UNI stream reception

The MUX now provides a single API for both uni and bidirectional
streams. It is responsible to reject reception on a local unidirectional
stream with the error STREAM_STATE_ERROR. This is already implemented in
qcc_recv(). As such, remove this duplicated check from xprt_quic.c.

3 years agoBUG/MINOR: quic: Fix QUIC_EV_CONN_PRSAFRM event traces
Frédéric Lécaille [Tue, 31 May 2022 10:04:42 +0000 (12:04 +0200)] 
BUG/MINOR: quic: Fix QUIC_EV_CONN_PRSAFRM event traces

This is a quic_frame struct pointer which must be passed as parameter
to TRACE_PROTO() for such an event.

3 years agoBUG/MEDIUM: h3: fix H3_EXCESSIVE_LOAD when receiving H3 frame header only
Amaury Denoyelle [Tue, 31 May 2022 12:18:33 +0000 (14:18 +0200)] 
BUG/MEDIUM: h3: fix H3_EXCESSIVE_LOAD when receiving H3 frame header only

The H3 frame demuxing code is incorrect when receiving a STREAM frame
which contains only a new H3 frame header without its payload.

In this case, the check on frames bigger than the buffer size is
incorrect. This is because the buffer has been freed via
qcs_consume()/qc_free_ncbuf() as it was emptied after H3 frame header
parsing. This causes the connection to be incorrectly closed with
H3_EXCESSIVE_LOAD error.

This bug was reproduced with xquic client on the interop and with the
command-line invocation :

$ ./interop_client -l d -k $SSLKEYLOGFILE -a <addr> -p <port> -D /tmp \
    -A h3 -U https://<addr>:<port>/hello_world.txt

Note also that h3_is_frame_valid() invocation has been moved before the
new buffer size check. This ensures that first we check the frame
validity before returning from the function. It's also better
positionned as this is only needed when a new H3 frame header has been
parsed.

3 years agoBUG/MINOR: h3: fix frame demuxing
Amaury Denoyelle [Tue, 31 May 2022 09:44:52 +0000 (11:44 +0200)] 
BUG/MINOR: h3: fix frame demuxing

The H3 demuxing code was not fully correct. After parsing the H3 frame
header, the check between frame length and buffer data is wrong as we
compare a copy of the buffer made before the H3 header removal.

Fix this by improving the H3 demuxing code API. h3_decode_frm_header()
now uses a ncbuf instance, this prevents an unnecessary cast
ncbuf/buffer in h3_decode_qcs() which resolves this error.

This bug was not triggered at this moment. Its impact should be really
limited.

3 years agoMINOR: ncbuf: adjust ncb_data with NCBUF_NULL
Amaury Denoyelle [Tue, 31 May 2022 09:44:25 +0000 (11:44 +0200)] 
MINOR: ncbuf: adjust ncb_data with NCBUF_NULL

Replace ncb_blk_is_null() by ncb_is_null() as a prelude to ncb_data().
The result is the same : the function will return 0 if the buffer is
uninitialized. However, it is clearer to directly call ncb_is_null() to
reflect this.

There is no functional change with this commit.

3 years agoDOC: install: update supported OpenSSL versions in the INSTALL doc
Willy Tarreau [Tue, 31 May 2022 09:37:37 +0000 (11:37 +0200)] 
DOC: install: update supported OpenSSL versions in the INSTALL doc

OpenSSL 3.0 is now supported but was not mentioned. Also, it was
found that OpenSSL 0.9.8 doesn't build anymore since 2.5 due to
some of the functions used in the JWT token processing, and since
nobody complained, it seems it's not worth fixing it so support for
it was removed.

3 years agoDOC: gpc/gpt: add commments of gpc/gpt array definitions on stick tables.
Emeric Brun [Fri, 25 Mar 2022 13:13:23 +0000 (14:13 +0100)] 
DOC: gpc/gpt: add commments of gpc/gpt array definitions on stick tables.

Some users misunderstood that the parameter of gpc() gpt()
store types on the table line presents the number of elements
of the array to store and not an index of gpt/gpc tag/counter.

This patch adds some explanations.

This patch addresses github issue #1630

It should be backorted in until branch 2.5.

3 years agoDOC: peers: fix port number and addresses on new peers section format
Emeric Brun [Mon, 30 May 2022 16:13:35 +0000 (18:13 +0200)] 
DOC: peers: fix port number and addresses on new peers section format

This patch fix the port number and addresses on the example
to match those of the old format.

This patch address the github issue #1492

This patch should be backported until version 2.0

3 years agoDOC: peers: clarify when entry expiration date is renewed.
Emeric Brun [Mon, 30 May 2022 16:08:28 +0000 (18:08 +0200)] 
DOC: peers: clarify when entry expiration date is renewed.

This patch add some details to know which rules are updating
the expiration timer of an entry.

It also adds a comment to know how to fetch a value without renewing
this timer.

This patch addresses github issue #615

This patch should be backported on all still supported branches

3 years agoDOC: peers: indicate that some server settings are not usable
Willy Tarreau [Tue, 31 May 2022 08:22:12 +0000 (10:22 +0200)] 
DOC: peers: indicate that some server settings are not usable

Let's make it clear in the peers documentation that not all server
parameters may be used, as there is some confusion around this, and
the doc was even misleading by saying that all parameters were
supported.

This should address github issue #919.

3 years agoBUG/MINOR: peers: detect and warn on init_addr/resolvers/check/agent-check
Willy Tarreau [Tue, 31 May 2022 07:42:44 +0000 (09:42 +0200)] 
BUG/MINOR: peers: detect and warn on init_addr/resolvers/check/agent-check

Some server keywords are currently silently ignored in the peers
section, which is not good because it wastes time on user-side, trying
to make something work while it cannot by design.

With this patch we at least report a few of them (the most common ones),
which are init_addr, resolvers, check, agent-check. Others might follow.

This may be backported to 2.5 to encourage some cleaning of bogus configs.

3 years agoMINOR: server: indicate when no address was expected for a server
Willy Tarreau [Tue, 31 May 2022 07:25:34 +0000 (09:25 +0200)] 
MINOR: server: indicate when no address was expected for a server

When parsing a peers section, it's particularly difficult to make the
difference between the local peer which doesn't have any address, and
other peers which need one, and the error messages do not help because
with just:

    peers foo
       bind :8001
       server foo 127.0.0.1:8001
       server bar 127.0.0.2:8001

One can get such a confusing message when the local peer is "bar":

  [peers.cfg:15] : 'server foo/bar' : unknown keyword '127.0.0.1:8001'.

It's not clear there why the other peer doesn't trigger an error.
With this commit we add a hint in the error message when no address
was expected. The error remains quite generic (since deep into the
server code) but at least the useer gets a hint about why the keyword
wasn't understood:

  [peers.cfg:15] : 'server foo/bar' : unknown keyword '127.0.0.1:8001'.
                   Hint: no address was expected for this server.

3 years agoBUG/MINOR: peers: set the proxy's name to the peers section name
Willy Tarreau [Tue, 31 May 2022 07:10:19 +0000 (09:10 +0200)] 
BUG/MINOR: peers: set the proxy's name to the peers section name

For some poor historical reasons, the name of a peers proxy used to be
set to the name of the local peer itself. That causes some confusion when
multiple sections are present because the same proxy name appears at
multiple places in "show peers", but since 2.5 where parsing errors include
the proxy name, a config like this one :

   peers foo
       server foobar blah

Would report this when the local peer name isn't "foobar":

   'server (null)/foobar' : invalid address: 'blah' in 'blah'

And this when it is foobar:

   'server foobar/foobar' : invalid address: 'blah' in 'blah'

This is wrong, confusing and not very practical. This commit addresses
all this by using the peers section's name when it's created. This now
allows to report messages such as:

   'server foo/foobar' : invalid address: 'blah' in 'blah'

Which make it clear that the section is called "foo" and the server
"foobar".

This may be backported to 2.5, though the patch may be simplified if
needed, by just adding the change at the output of init_peers_frontend().

3 years agoCLEANUP: peers/cli: make peers_dump_peer() take an appctx instead of an stconn
Willy Tarreau [Tue, 31 May 2022 06:55:54 +0000 (08:55 +0200)] 
CLEANUP: peers/cli: make peers_dump_peer() take an appctx instead of an stconn

By having the appctx in argument this function wouldn't have experienced
the previous bug. Better do that now to avoid proliferation of awkward
functions.

3 years agoCLEANUP: peers/cli: stop misusing the appctx local variable
Willy Tarreau [Tue, 31 May 2022 06:53:25 +0000 (08:53 +0200)] 
CLEANUP: peers/cli: stop misusing the appctx local variable

In the context of a CLI command, it's particularly not welcome to use
an "appctx" variable that is not the current one. In addition it was
created for use at exactly 6 places in 2 lines. Let's just remove it
and stick to peer->appctx which is used elsewhere in the function and
is unambiguous.

3 years agoBUG/MEDIUM: peers/cli: fix "show peers" crash
Willy Tarreau [Tue, 31 May 2022 06:49:29 +0000 (08:49 +0200)] 
BUG/MEDIUM: peers/cli: fix "show peers" crash

Commit d0a06d52f ("CLEANUP: applet: use applet_put*() everywhere possible")
replaced most accesses to the conn_stream with simpler accesses to the
appctx. Unfortunately, in all the CLI functions using an appctx, one
makes an exception where the appctx is not the caller's but the one being
inspected! When no peers connection is active, the early exit immediately
crashes.

No backport is needed.

3 years agoDOC: fix a few spelling mistakes in the docs
Willy Tarreau [Tue, 31 May 2022 06:07:43 +0000 (08:07 +0200)] 
DOC: fix a few spelling mistakes in the docs

These were reported by the CI's spell checker:

   https://github.com/haproxy/haproxy/actions/runs/2411893527

A few need to be ignored ("ressources" and "trafic" being part of a URL).

3 years agoBUILD: makefile: reorder objects by build time
Willy Tarreau [Mon, 30 May 2022 17:24:27 +0000 (19:24 +0200)] 
BUILD: makefile: reorder objects by build time

As usual, let's sort objects by inverse build time at -O2. It will
still vary based on the options but keeps them optimally sorted for
parallel builds.

3 years agoEXAMPLES: remove completely outdated acl-content-sw.cfg
Willy Tarreau [Mon, 30 May 2022 16:14:24 +0000 (18:14 +0200)] 
EXAMPLES: remove completely outdated acl-content-sw.cfg

This config probably last worked on 1.3, maybe 1.4, but it uses too
many obsolete statements and it silently errors because of the "quiet"
directive, which adds to the confusion. Let's remove it.

3 years agoMINOR: h3: add traces on h3s init/end
Amaury Denoyelle [Mon, 30 May 2022 13:51:31 +0000 (15:51 +0200)] 
MINOR: h3: add traces on h3s init/end

Add events when h3s instances are created/initialized and released.

3 years agoMINOR: h3: add traces on frame send
Amaury Denoyelle [Mon, 30 May 2022 13:51:01 +0000 (15:51 +0200)] 
MINOR: h3: add traces on frame send

Add h3 traces events for several sent frames : SETTINGS, HEADERS and
DATA.

3 years agoMINOR: h3: add traces on frame recv
Amaury Denoyelle [Mon, 30 May 2022 13:50:34 +0000 (15:50 +0200)] 
MINOR: h3: add traces on frame recv

Add h3 traces events for several received frames : SETTINGS, HEADERS and
DATA.

3 years agoMINOR: h3: define h3 trace module
Amaury Denoyelle [Mon, 30 May 2022 13:49:36 +0000 (15:49 +0200)] 
MINOR: h3: define h3 trace module

A new 'h3' trace module is introduced. It will be used to centralize
events related to HTTP/3 status.

3 years agoDOC: add maintainers for QUIC and HTTP/3
Amaury Denoyelle [Mon, 30 May 2022 15:32:21 +0000 (17:32 +0200)] 
DOC: add maintainers for QUIC and HTTP/3

Frédéric Lécaille and Amaury Denoyelle are the official maintainers of
QUIC and HTTP/3.

3 years agoDOC: remove the outdated ROADMAP file
Willy Tarreau [Mon, 30 May 2022 15:00:26 +0000 (17:00 +0200)] 
DOC: remove the outdated ROADMAP file

It's almost never update (last time was 3 years ago) and contains both
stuff that was already implemented and stuff that nobody's interested in
anymore. Let's remove it.

3 years agoDOC: internal: remove totally outdated diagrams
Willy Tarreau [Mon, 30 May 2022 14:56:42 +0000 (16:56 +0200)] 
DOC: internal: remove totally outdated diagrams

The "sequence" and "entities" diagrams have become so much outdated that
they are at best confusing, but more generally wrong. Let's simply remove
them.

3 years agoBUILD: quic: use inttypes.h instead of stdint.h
Willy Tarreau [Mon, 30 May 2022 14:37:17 +0000 (16:37 +0200)] 
BUILD: quic: use inttypes.h instead of stdint.h

The usual build joke on uncommon systems (AIX this time, though some
versions of Solaris are known for missing it as well).

3 years agoBUILD: htx: use the unchecked version of htx_get_head_blk() where needed
Willy Tarreau [Mon, 30 May 2022 14:27:48 +0000 (16:27 +0200)] 
BUILD: htx: use the unchecked version of htx_get_head_blk() where needed

stream.c and mux_fcgi.c may cause a warning for a possible NULL deref
at -Os, while that is not possible thanks to the previous test. Let's
just switch to __htx_get_head_blk() instead.

3 years agoMINOR: htx: add an unchecked version of htx_get_head_blk()
Willy Tarreau [Mon, 30 May 2022 14:25:16 +0000 (16:25 +0200)] 
MINOR: htx: add an unchecked version of htx_get_head_blk()

htx_get_head_blk() is used at plenty of places, many of which are known
to be safe, but the function checks for the presence of a first block
and returns NULL if it doesn't exist. While it's properly used, it makes
compilers complain at -Os on stream.c and mux_fcgi.c because they probably
don't propagate variables far enough to see that there's no risk.

Let's add an unchecked version for these use cases.

3 years agoSCRIPTS: make publish-release try to launch make-releases-json
Willy Tarreau [Mon, 30 May 2022 13:34:51 +0000 (15:34 +0200)] 
SCRIPTS: make publish-release try to launch make-releases-json

Now when publishing a release, if make-releases-json is usable at the same
place, it will be called to regenerate the json index of available versions.

3 years agoSCRIPTS: add make-releases-json to recreate a releases.json file in download dirs
Willy Tarreau [Mon, 30 May 2022 13:19:06 +0000 (15:19 +0200)] 
SCRIPTS: add make-releases-json to recreate a releases.json file in download dirs

This will be used to rebuild a releases.json file in each download
directory. It only relies on existing files and sorts them by version,
appends known signatures (md5/sha256) and marks the most recent one as
the latest release.

This aims at addressing github issue #1537.

3 years agoBUG/MINOR: h3: do not report bug on unknown method
Amaury Denoyelle [Mon, 30 May 2022 08:18:46 +0000 (10:18 +0200)] 
BUG/MINOR: h3: do not report bug on unknown method

Remove an unneeded BUG_ON statement when find_http_meth() returns
HTTP_METH_OTHER.

This fix is necessary to support requests with unusual methods with
DEBUG_STRICT activated. This was detected when browsing with HTTP/3 over
a nextcloud instance which uses PROPFIND method for Webdav.

3 years agoBUG/MINOR: qpack: support bigger prefix-integer encoding
Amaury Denoyelle [Mon, 30 May 2022 12:24:40 +0000 (14:24 +0200)] 
BUG/MINOR: qpack: support bigger prefix-integer encoding

Prefix-integer encoding function was incomplete. It was not able to deal
correctly with value encoded on more than 2 bytes. This maximum value depends
on the size of the prefix, but value greater than 254 were all impacted.

Most notably, this change is required to support header name/value with
sizeable length. Previously, length was incorrectly encoded. The client thus
closed the connection with QPACK_DECOMPRESSION_ERROR.

3 years agoBUG/MINOR: qpack: fix buffer API usage on prefix integer encoding
Amaury Denoyelle [Mon, 30 May 2022 09:58:06 +0000 (11:58 +0200)] 
BUG/MINOR: qpack: fix buffer API usage on prefix integer encoding

Replace bogus call b_data() by b_room() to check if there is enough
space left in the buffer before encoding a prefix integer.

At this moment, no real scenario was found to trigger a bug related to
this change. This is probably because the buffer always contains data
(field section line and status code) before calling
qpack_encode_prefix_integer() which prevents an occurrence of this bug.

3 years agoMINOR: quic: Do not drop packets with RESET_STREAM frames
Frédéric Lécaille [Sun, 29 May 2022 09:48:58 +0000 (11:48 +0200)] 
MINOR: quic: Do not drop packets with RESET_STREAM frames

If the connection client timeout has expired, the mux is released.
If the client decides to initiate a new request, we send a STOP_SENDING
frame. Then, the client endessly sends a RESET_STREAM frame.

At this time, we simulate the fact that we support the RESET_STREAM frame
thanks to this ridiculously minimalistic patch.

3 years agoMINOR: quic: Send STOP_SENDING frames if mux is released
Frédéric Lécaille [Sun, 29 May 2022 09:36:03 +0000 (11:36 +0200)] 
MINOR: quic: Send STOP_SENDING frames if mux is released

If the connection client timeout has expired, the mux is released.
If the client decides to initiate a new request, we do not ack its
request. This leads the client to endlessly sent it request.

This patch makes a QUIC listener send a STOP_SENDING frame in such
a situation.

3 years agoMINOR: h3: Add a statistics module for h3
Frédéric Lécaille [Wed, 25 May 2022 20:25:37 +0000 (22:25 +0200)] 
MINOR: h3: Add a statistics module for h3

Add ->inc_err_cnt new callback to qcc_app_ops struct which can
be called from xprt to increment the application level error code counters.
It take the application context as first parameter to be generic and support
new QUIC applications to come.
Add h3_stats.c module with counters for all the frame types and error codes.

3 years agoMINOR: quic: Connection TX buffer setting renaming.
Frédéric Lécaille [Wed, 25 May 2022 15:14:28 +0000 (17:14 +0200)] 
MINOR: quic: Connection TX buffer setting renaming.

Rename "tune.quic.conn-buf-limit" to "tune.quic.frontend.conn-tx-buffers.limit"
to reflect the stream direction (TX) and the objects (frontends) which are
concerned.

3 years agoDOC: quic: Documentation update for QUIC
Frédéric Lécaille [Wed, 25 May 2022 13:42:15 +0000 (15:42 +0200)] 
DOC: quic: Documentation update for QUIC

Add minimalistic information about QUIC new protocol supported by QUIC.

3 years agoMINOR: quic_stats: Add transport new counters (lost, stateless reset, drop)
Frédéric Lécaille [Tue, 24 May 2022 14:01:39 +0000 (16:01 +0200)] 
MINOR: quic_stats: Add transport new counters (lost, stateless reset, drop)

Add new counters to count the number of dropped packet upon parsing error, lost
sent packets and the number of stateless reset packet sent.
Take the oppportunity of this patch to rename CONN_OPENINGS to QUIC_ST_HALF_OPEN_CONN
(total number of half open connections) and QUIC_ST_HDSHK_FAILS to QUIC_ST_HDSHK_FAIL.

3 years agoBUG/MINOR: quic: Largest RX packet numbers mixing
Frédéric Lécaille [Tue, 24 May 2022 08:54:42 +0000 (10:54 +0200)] 
BUG/MINOR: quic: Largest RX packet numbers mixing

When we select the next encryption level in qc_treat_rx_pkts() we
must reset the local largest_pn variable if we do not want to reuse its
previous value for this encryption. This bug could only happend during
handshake step and had no visible impact because this variable
is only used during the header protection removal step which hopefully
supports the packet reordering.

3 years agoMINOIR: quic_stats: add QUIC connection errors counters
Frédéric Lécaille [Mon, 23 May 2022 20:54:54 +0000 (22:54 +0200)] 
MINOIR: quic_stats: add QUIC connection errors counters

Add statistical counters for all the transport level connection errrors.

3 years agoMINOR: quic: Clarifications about transport parameters value
Frédéric Lécaille [Mon, 23 May 2022 16:29:39 +0000 (18:29 +0200)] 
MINOR: quic: Clarifications about transport parameters value

This is becoming difficult to distinguish the default values for
transport parameters which come with the RFC from our implementation
default values when not set by configuration (tunable parameters).
Add a comment to distinguish them.
Prefix these default values by QUIC_TP_DFLT_ to distinguish them from
QUIC_DFLT_* value even if there are not numerous.
Furthermore ->max_udp_payload_size must be first initialized to
QUIC_TP_DFLT_MAX_UDP_PAYLOAD_SIZE especially for received value.

3 years agoMINOR: quic: Tunable "initial_max_streams_bidi" transport parameter
Frédéric Lécaille [Mon, 23 May 2022 15:28:01 +0000 (17:28 +0200)] 
MINOR: quic: Tunable "initial_max_streams_bidi" transport parameter

Add tunable "tune.quic.frontend.max_streams_bidi" setting for QUIC frontends
to set the "initial_max_streams_bidi" transport parameter.
Add some documentation for this new setting.

3 years agoMINOR: quic: Tunable "max_idle_timeout" transport parameter
Frédéric Lécaille [Mon, 23 May 2022 14:38:14 +0000 (16:38 +0200)] 
MINOR: quic: Tunable "max_idle_timeout" transport parameter

Add two tunable settings both for backends and frontends "max_idle_timeout"
QUIC transport parameter, "tune.quic.frontend.max-idle-timeout" and
"tune.quic.backend.max-idle-timeout" respectively.
cfg_parse_quic_time() has been implemented to parse a time value thanks
to parse_time_err(). It should be reused for any tunable time value to be
parsed.
Add the documentation for this tunable setting only for frontend.

3 years agoDOC: quic: Update documentation for QUIC Retry
Frédéric Lécaille [Mon, 23 May 2022 09:38:58 +0000 (11:38 +0200)] 
DOC: quic: Update documentation for QUIC Retry

Add some information for "quic-force-retry" and "tune.quic.retry-force"
settings.

3 years agoMINOR: quic: Transport parameters dump
Frédéric Lécaille [Mon, 23 May 2022 07:08:54 +0000 (09:08 +0200)] 
MINOR: quic: Transport parameters dump

Add quic_transport_params_dump() static inline function to do so for
a quic_transport_parameters struct as parameter.
We use the trace API do dump these transport parameters both
after they have been initialized (RX/local) or received (TX/remote).

3 years agoMINOR: quic: QUIC transport parameters split.
Frédéric Lécaille [Sat, 21 May 2022 21:58:40 +0000 (23:58 +0200)] 
MINOR: quic: QUIC transport parameters split.

Make the transport parameters be standlone as much as possible as
it consists only in encoding/decoding data into/from buffers.
Reduce the size of xprt_quic.h. Unfortunalety, I think we will
have to continue to include <xprt_quic-t.h> to use the trace API
into this module.

3 years agoCLEANUP: quic: No more used handshake output buffer
Frédéric Lécaille [Sat, 21 May 2022 20:36:08 +0000 (22:36 +0200)] 
CLEANUP: quic: No more used handshake output buffer

->obuf quic_conn struct member is no more used.

3 years agoCLEANUP: quic: Useless QUIC_CONN_TX_BUF_SZ definition
Frédéric Lécaille [Sat, 21 May 2022 20:32:25 +0000 (22:32 +0200)] 
CLEANUP: quic: Useless QUIC_CONN_TX_BUF_SZ definition

This define is not more used.

3 years agoMINOR: quic: Ignore out of packet padding.
Frédéric Lécaille [Sat, 21 May 2022 12:42:21 +0000 (14:42 +0200)] 
MINOR: quic: Ignore out of packet padding.

We do not want to count the out of packet padding as being belonging
to an invalid packet, the firt byte of a QUIC packet being never null.
Some browsers like firefox proceeds this way to add PADDING frames
after an Initial packet and increase the size of their Initial packets.

3 years agoCLEANUP: muxes: Consider stream's sd as defined in .show_fd callback functions
Christopher Faulet [Mon, 30 May 2022 06:45:15 +0000 (08:45 +0200)] 
CLEANUP: muxes: Consider stream's sd as defined in .show_fd callback functions

In muxes, the stream-endoint descriptor of a stream is always defined. Thus,
in .show_fd callback functions, there is no reason to test it.

This patch should address the issue #1727.
.

3 years agoCLEANUP: tcpcheck: Remove useless test on the stream-connector in tcpcheck_main
Christopher Faulet [Mon, 30 May 2022 06:37:39 +0000 (08:37 +0200)] 
CLEANUP: tcpcheck: Remove useless test on the stream-connector in tcpcheck_main

Thanks to the recent refactoring, when tcpcheck_main() function is called,
the stream-connector of the healthchek is always defined. There is no reason
to still test it.

This patch should fix the issue #1721.

3 years agoDOC: Fix formatting in configuration.txt to fix dconv
Tim Duesterhus [Fri, 27 May 2022 21:20:36 +0000 (23:20 +0200)] 
DOC: Fix formatting in configuration.txt to fix dconv

The missing space before the colon causes haproxy-dconv to misparse the
configuration.txt.

3 years ago[RELEASE] Released version 2.6-dev12 v2.6-dev12
Willy Tarreau [Fri, 27 May 2022 17:49:31 +0000 (19:49 +0200)] 
[RELEASE] Released version 2.6-dev12

Released version 2.6-dev12 with the following main changes :
    - CLEANUP: tools: Clean up non-QUIC error message handling in str2sa_range()
    - BUG/MEDIUM: tools: Fix `inet_ntop` usage in sa2str
    - CLEANUP: tools: Crash if inet_ntop fails due to ENOSPC in sa2str
    - BUG/MEDIUM: mux-quic: adjust buggy proxy closing support
    - Revert "MINOR: quic: activate QUIC traces at compilation"
    - Revert "MINOR: mux-quic: activate qmux traces on stdout via macro"
    - CLEANUP: init: address a coverity warning about possible multiply overflow
    - BUG/MEDIUM: http: Properly reject non-HTTP/1.x protocols
    - MEDIUM: h1: enlarge the scope of accepted version chars with accept-invalid-http-request
    - BUG/MEDIUM: resolvers: Don't defer resolutions release in deinit function
    - BUG/MEDIUM: peers: fix segfault using multiple bind on peers sections
    - BUG/MEDIUM: peers: prevent unitialized multiple listeners on peers section
    - BUG/MINOR: task: Don't defer tasks release when HAProxy is stopping
    - MINOR: h3: mark ncbuf as const on h3_b_dup
    - MINOR: mux-quic: do not alloc quic_stream_desc for uni remote stream
    - MINOR: mux-quic: delay cs_endpoint allocation
    - MINOR: mux-quic: add traces in qc_recv()
    - MINOR: mux-quic: adjust return value of decode_qcs
    - CLEANUP: h3: rename struct h3 -> h3c
    - CLEANUP: h3: rename uni stream type constants
    - BUG/MINOR: h3: prevent overflow when parsing SETTINGS
    - MINOR: h3: refactor h3_control_send()
    - MINOR: quic: support CONNECTION_CLOSE_APP emission
    - MINOR: mux-quic: disable read on CONNECTION_CLOSE emission
    - MINOR: h3: reject too big frames
    - MINOR: mux-quic: emit STREAM_STATE_ERROR in qcc_recv
    - BUG/MINOR: mux-quic: refactor uni streams TX/send H3 SETTINGS
    - MINOR: h3/qpack: use qcs as type in decode callbacks
    - MINOR: h3: define stream type
    - MINOR: h3: refactor uni streams initialization
    - MINOR: h3: check if frame is valid for stream type
    - MINOR: h3: define non-h3 generic parsing function
    - MEDIUM: quic: refactor uni streams RX
    - CLEANUP: h3: remove h3 uni tasklet
    - MINOR: h3: abort read on unknown uni stream
    - MINOR: h3: refactor SETTINGS parsing/error reporting
    - Revert "BUG/MINOR: task: Don't defer tasks release when HAProxy is stopping"
    - DOC: configuration: add a warning for @system-ca on bind
    - CLEANUP: init: address another coverity warning about a possible multiply overflow
    - BUG/MINOR: ssl/lua: use correctly cert_ext in CertCache.set()
    - BUG/MEDIUM: sample: Fix adjusting size in word converter
    - REGTESTS: Do not use REQUIRE_VERSION for HAProxy 2.5+ (2)
    - CLEANUP: conn_stream: remove unneeded exclusion of RX_WAIT_EP from RXBLK_ANY
    - CLEANUP: conn_stream: rename the cs_endpoint's context to "conn"
    - MINOR: conn_stream: add new sets of functions to set/get endpoint flags
    - DEV: coccinelle: add cs_endp_flags.cocci
    - CLEANUP: conn_stream: apply cs_endp_flags.cocci tree-wide
    - DEV: coccinelle: add endp_flags.cocci
    - CLEANUP: conn_stream: apply endp_flags.cocci tree-wide
    - CLEANUP: conn_stream: rename the stream endpoint flags CS_EP_* to  SE_FL_*
    - CLEANUP: conn_stream: rename the cs_endpoint's target to "se"
    - CLEANUP: conn_stream: rename cs_endpoint to sedesc (stream endpoint descriptor)
    - CLEANUP: applet: rename the sedesc pointer from "endp" to "sedesc"
    - CLEANUP: conn_stream: rename the conn_stream's endp to sedesc
    - CLEANUP: conn_stream: rename cs_app_* to sc_app_*
    - CLEANUP: conn_stream: tree-wide rename to stconn (stream connector)
    - CLEANUP: mux-h1: add and use h1s_sc() to retrieve the stream connector
    - CLEANUP: mux-h2: add and use h2s_sc() to retrieve the stream connector
    - CLEANUP: mux-fcgi: add and use fcgi_strm_sc() to retrieve the stream connector
    - CLEANUP: mux-pt: add and use pt_sc() to retrieve the stream connector
    - CLEANUP: stdesc: rename the stream connector ->cs field to ->sc
    - CLEANUP: stream: rename "csf" and "csb" to "scf" and "scb"
    - CLEANUP: stconn: tree-wide rename stream connector flags CS_FL_* to SC_FL_*
    - CLEANUP: stconn: tree-wide rename stconn states CS_ST/SB_* to SC_ST/SB_*
    - MINOR: check: export wake_srv_chk()
    - MINOR: conn_stream: test the various ops functions before calling them
    - MEDIUM: stconn: merge the app_ops and the data_cb fields
    - MINOR: applet: add new wrappers to put chk/blk/str/chr to channel from appctx
    - CLEANUP: applet: use applet_put*() everywhere possible
    - CLEANUP: stconn: rename cs_{i,o}{b,c} to sc_{i,o}{b,c}
    - CLEANUP: stconn: rename cs_{check,strm,strm_task} to sc_strm_*
    - CLEANUP: stconn: rename cs_conn() to sc_conn()
    - CLEANUP: stconn: rename cs_mux() to sc_mux_strm()
    - CLEANUP: stconn: rename cs_conn_mux() to sc_mux_ops()
    - CLEANUP: stconn: rename cs_appctx() to sc_appctx()
    - CLEANUP: stconn: rename __cs_endp_target() to __sc_endp()
    - CLEANUP: stconn: rename cs_get_data_name() to sc_get_data_name()
    - CLEANUP: stconn: rename cs_conn_*() to sc_conn_*()
    - CLEANUP: stconn: rename cs_conn_get_first() to conn_get_first_sc()
    - CLEANUP: stconn: rename cs_ep_set_error() to se_fl_set_error()
    - CLEANUP: stconn: make a few functions take a const argument
    - CLEANUP: stconn: use a single function to know if SC may send to SE
    - MINOR: stconn: consider CF_SHUTW for sc_is_send_allowed()
    - MINOR: stconn: remove calls to cs_done_get()
    - MEDIUM: stconn: always rely on CF_SHUTR in addition to cs_rx_blocked()
    - MEDIUM: stconn: remove SE_FL_RXBLK_SHUT
    - MINOR: stconn: rename SE_FL_RXBLK_CONN to SE_FL_APPLET_NEED_CONN
    - MEDIUM: stconn: take SE_FL_APPLET_NEED_CONN out of the RXBLK_ANY flags
    - CLEANUP: stconn: rename cs_rx_room_{blk,rdy} to sc_{need,have}_room()
    - CLEANUP: stconn: rename cs_rx_chan_{blk,rdy} to sc_{wont,will}_read()
    - CLEANUP: stconn: rename cs_rx_buff_{blk,rdy} to sc_{need,have}_buff()
    - MINOR: stconn: start to rename cs_rx_endp_{more,done}() to se_have_{no_,}more_data()
    - MINOR: stconn: add sc_is_recv_allowed() to check for ability to receive
    - CLEANUP: stconn: rename SE_FL_RX_WAIT_EP to SE_FL_HAVE_NO_DATA
    - MEDIUM: stconn: move the RXBLK flags to the stream connector
    - CLEANUP: stconn: rename SE_FL_WANT_GET to SE_FL_WILL_CONSUME
    - CLEANUP: stconn: remove cs_tx_blocked() and cs_tx_endp_ready()
    - CLEANUP: stconn: rename cs_{want,stop}_get() to se_{will,wont}_consume()
    - CLEANUP: stconn: rename cs_cant_get() to se_need_more_data()
    - CLEANUP: stconn: rename cs_{new,create,free,destroy}_* to sc_*
    - CLEANUP: stconn: rename remaining management functions from cs_* to sc_*
    - CLEANUP: stconn: rename cs{,_get}_{src,dst} to sc_*
    - CLEANUP: stconn: rename cs_{shut,chk}* to sc_*
    - CLEANUP: stconn: rename final state manipulation functions from cs_* to sc_*
    - CLEANUP: quic: drop the name "conn_stream" from the pool variable names
    - REORG: rename cs_utils.h to sc_strm.h
    - REORG: stconn: rename conn_stream.{c,h} to stconn.{c,h}
    - CLEANUP: muxes: rename "get_first_cs" to "get_first_sc"
    - DEV: flags: use "sc" for stream conns instead of "cs"
    - CLEANUP: check: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: connection: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: stconn: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: quic/h3: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: stream: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: promex: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: stats: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: cli: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: applet: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: cache: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: dns: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: spoe: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: hlua: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: log-forward: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: http-client: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: mux-fcgi: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: mux-h1: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: mux-h2: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: mux-pt: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: peers: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: sink: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: sslsock: remove only occurrence of local variable "cs"
    - CLEANUP: applet: rename appctx_cs() to appctx_sc()
    - CLEANUP: stream: rename stream_upgrade_from_cs() to stream_upgrade_from_sc()
    - CLEANUP: obj_type: rename OBJ_TYPE_CS to OBJ_TYPE_SC
    - CLEANUP: stconn: replace a few remaining occurrences of CS in comments or traces
    - DOC: internal: update the muxes doc to mention the stconn
    - CLEANUP: mux-quic: rename the "endp" field to "sd"
    - CLEANUP: mux-h1: rename the "endp" field to "sd"
    - CLEANUP: mux-h2: rename the "endp" field to "sd"
    - CLEANUP: mux-fcgi: rename the "endp" field to "sd"
    - CLEANUP: mux-pt: rename the "endp" field to "sd"
    - CLEANUP: stconn: rename a few "endp" arguments and variables to "sd"
    - MINOR: stconn: turn SE_FL_WILL_CONSUME to SE_FL_WONT_CONSUME
    - CLEANUP: stream: remove unneeded test on appctx during initialization
    - CLEANUP: stconn: remove the new unneeded SE_FL_APP_MASK
    - DEV: flags: fix "siet" shortcut name
    - DEV: flags: rename the "endp" shortcut to "sd" for "stream descriptor"
    - DEV: flags: reorder a few SC/SE flags
    - DOC: internal: add a description of the stream connectors and descriptors

3 years agoDOC: internal: add a description of the stream connectors and descriptors
Willy Tarreau [Fri, 27 May 2022 15:47:16 +0000 (17:47 +0200)] 
DOC: internal: add a description of the stream connectors and descriptors

The "layers" mini-doc shows how streams, stconn, sedesc, conns, applets
and muxes interact, with field names, pointers and invariants. It should
be completed but already provides a quick overview about what can be
guaranteed at any step and at different layers.

3 years agoDEV: flags: reorder a few SC/SE flags
Willy Tarreau [Fri, 27 May 2022 14:35:20 +0000 (16:35 +0200)] 
DEV: flags: reorder a few SC/SE flags

Some stream connector and stream endpoints flags were not printed in
the correct order, they were updated.

3 years agoDEV: flags: rename the "endp" shortcut to "sd" for "stream descriptor"
Willy Tarreau [Fri, 27 May 2022 14:29:30 +0000 (16:29 +0200)] 
DEV: flags: rename the "endp" shortcut to "sd" for "stream descriptor"

This way we don't keep the possibly confusing endp one anymore.

3 years agoDEV: flags: fix "siet" shortcut name
Willy Tarreau [Fri, 27 May 2022 14:26:31 +0000 (16:26 +0200)] 
DEV: flags: fix "siet" shortcut name

It "si->et" was changed to "strm->et" by commit 09b3c5559 ("DEV: flags:
No longer dump SI flags") but this shortcut was missed.

3 years agoCLEANUP: stconn: remove the new unneeded SE_FL_APP_MASK
Willy Tarreau [Fri, 27 May 2022 15:03:34 +0000 (17:03 +0200)] 
CLEANUP: stconn: remove the new unneeded SE_FL_APP_MASK

The only two places where it was used was to carefully preserve the
SE_FL_WILL_CONSUME flag (since others are irrelevant there and the
previous RXBLK* flags moved to the stconn). Now that the flag is
cleared by default there's no need to re-created a fresh new one
when replacing the descriptor, so we can eliminate that remaining
trick.

3 years agoCLEANUP: stream: remove unneeded test on appctx during initialization
Willy Tarreau [Fri, 27 May 2022 14:49:18 +0000 (16:49 +0200)] 
CLEANUP: stream: remove unneeded test on appctx during initialization

Now that the data consumption from the endpoint is the default setting,
we can generalize the pre-clearing of the wont_consume flag, which is
no more specific to applets. In practice it's not needed anymore to do
it, but since streams might be initiatied from asynchronous applets,
these might have blocked their consumption side before creating the
stream thus it's safer to preserve the clearing of the flag.

3 years agoMINOR: stconn: turn SE_FL_WILL_CONSUME to SE_FL_WONT_CONSUME
Willy Tarreau [Fri, 27 May 2022 14:43:52 +0000 (16:43 +0200)] 
MINOR: stconn: turn SE_FL_WILL_CONSUME to SE_FL_WONT_CONSUME

This flag was the only remaining one that was inverted as a blocking
condition, requiring special handling to preset it on sedesc allocation.
Let's flip it in its definition and accessors.

3 years agoCLEANUP: stconn: rename a few "endp" arguments and variables to "sd"
Willy Tarreau [Fri, 27 May 2022 14:21:33 +0000 (16:21 +0200)] 
CLEANUP: stconn: rename a few "endp" arguments and variables to "sd"

For consistency with the few other places, let's avoid using the
confusing "endp" pointer when it designates the descriptor.

3 years agoCLEANUP: mux-pt: rename the "endp" field to "sd"
Willy Tarreau [Fri, 27 May 2022 14:17:23 +0000 (16:17 +0200)] 
CLEANUP: mux-pt: rename the "endp" field to "sd"

The stream endpoint descriptor that was named "endp" is now called "sd"
both in the mux_pt_ctx struct and in the few functions using this.

3 years agoCLEANUP: mux-fcgi: rename the "endp" field to "sd"
Willy Tarreau [Fri, 27 May 2022 14:15:32 +0000 (16:15 +0200)] 
CLEANUP: mux-fcgi: rename the "endp" field to "sd"

The stream endpoint descriptor that was named "endp" is now called "sd"
both in the fcgi_strm struct and in the few functions using this. The
name was also updated in the "show fd" output.

3 years agoCLEANUP: mux-h2: rename the "endp" field to "sd"
Willy Tarreau [Fri, 27 May 2022 14:14:10 +0000 (16:14 +0200)] 
CLEANUP: mux-h2: rename the "endp" field to "sd"

The stream endpoint descriptor that was named "endp" is now called "sd"
both in the h2s struct and in the few functions using this. The name
was also updated in the "show fd" output.

3 years agoCLEANUP: mux-h1: rename the "endp" field to "sd"
Willy Tarreau [Fri, 27 May 2022 14:12:05 +0000 (16:12 +0200)] 
CLEANUP: mux-h1: rename the "endp" field to "sd"

The stream endpoint descriptor that was named "endp" is now called "sd"
both in the h1s struct and in the few functions using this. The name
was also updated in the "show fd" output.

3 years agoCLEANUP: mux-quic: rename the "endp" field to "sd"
Willy Tarreau [Fri, 27 May 2022 14:09:35 +0000 (16:09 +0200)] 
CLEANUP: mux-quic: rename the "endp" field to "sd"

The stream endpoint descriptor that was named "endp" is now called "sd"
both in the qcs struct and in the few functions using this.

3 years agoDOC: internal: update the muxes doc to mention the stconn
Willy Tarreau [Fri, 27 May 2022 09:45:50 +0000 (11:45 +0200)] 
DOC: internal: update the muxes doc to mention the stconn

The stream connector replaced the conn_stream and the sc_conn_io_cb()
function appeared. There's no place there to mention the endpoint
descriptor, but a separate diagram showing the relation between stream
and endpoint via the connector would be nice.

3 years agoCLEANUP: stconn: replace a few remaining occurrences of CS in comments or traces
Willy Tarreau [Fri, 27 May 2022 09:23:05 +0000 (11:23 +0200)] 
CLEANUP: stconn: replace a few remaining occurrences of CS in comments or traces

A few "CS" desginating stconns were still present in code comments and
stream traces. This addresses them.

3 years agoCLEANUP: obj_type: rename OBJ_TYPE_CS to OBJ_TYPE_SC
Willy Tarreau [Fri, 27 May 2022 09:15:19 +0000 (11:15 +0200)] 
CLEANUP: obj_type: rename OBJ_TYPE_CS to OBJ_TYPE_SC

Let's apply the new name to the type as well.

3 years agoCLEANUP: stream: rename stream_upgrade_from_cs() to stream_upgrade_from_sc()
Willy Tarreau [Fri, 27 May 2022 09:11:15 +0000 (11:11 +0200)] 
CLEANUP: stream: rename stream_upgrade_from_cs() to stream_upgrade_from_sc()

It upgrades the protocol on a stream connector, let's update the name.