]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: quic-be: make SSL/QUIC objects use their own indexes (ssl_qc_app_data_index)
authorFrederic Lecaille <flecaille@haproxy.com>
Wed, 10 Sep 2025 16:11:50 +0000 (18:11 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 11 Sep 2025 07:51:28 +0000 (09:51 +0200)
commit5027ba36a99754328845386c0f62a646aa02ea54
treeef132c0f1d570a58c698591a49d329c484b10083
parent47bb15ca84d09a56f596114591457af24ea3a626
MINOR: quic-be: make SSL/QUIC objects use their own indexes (ssl_qc_app_data_index)

This index is used to retrieve the quic_conn object from its SSL object, the same
way the connection is retrieved from its SSL object for SSL/TCP connections.

This patch implements two helper functions to avoid the ugly code with such blocks:

   #ifdef USE_QUIC
   else if (qc) { .. }
   #endif

Implement ssl_sock_get_listener() to return the listener from an SSL object.
Implement ssl_sock_get_conn() to return the connection from an SSL object
and optionally a pointer to the ssl_sock_ctx struct attached to the connections
or the quic_conns.

Use this functions where applicable:
   - ssl_tlsext_ticket_key_cb() calls ssl_sock_get_listener()
   - ssl_sock_infocbk() calls ssl_sock_get_conn()
   - ssl_sock_msgcbk() calls ssl_sock_get_ssl_conn()
   - ssl_sess_new_srv_cb() calls ssl_sock_get_conn()
   - ssl_sock_srv_verifycbk() calls ssl_sock_get_conn()

Also modify qc_ssl_sess_init() to initialize the ssl_qc_app_data_index index for
the QUIC backends.
include/haproxy/ssl_sock.h
src/quic_ssl.c
src/ssl_sock.c