MEDIUM: quic: limit handshake per listener
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 6 Nov 2023 15:34:38 +0000 (16:34 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 9 Nov 2023 15:23:52 +0000 (16:23 +0100)
commit3df6a60113773d8abff3457c7a06e30c1892b7dc
tree88a91f3e3627cbd6dcdb94b73aa0f67b46f2d120
parent278808915b05bab1ff1e08e95fe32be22109719f
MEDIUM: quic: limit handshake per listener

Implement a limit per listener for concurrent number of QUIC
connections. When reached, INITIAL packets for new connections are
automatically dropped until the number of handshakes is reduced.

The limit value is automatically based on listener backlog, which itself
defaults to maxconn.

This feature is important to ensure CPU and memory resources are not
consume if too many handshakes attempt are started in parallel.

Special care is taken if a connection is released before handshake
completion. In this case, counter must be decremented. This forces to
ensure that member <qc.state> is set early in qc_new_conn() before any
quic_conn_release() invocation.
doc/configuration.txt
include/haproxy/quic_sock.h
include/haproxy/receiver-t.h
src/cfgparse.c
src/quic_conn.c
src/quic_rx.c
src/quic_sock.c
src/quic_ssl.c