]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: ssl: remove dead code in ssl_sock_from_buf()
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 19 Nov 2025 10:00:05 +0000 (11:00 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 19 Nov 2025 10:00:05 +0000 (11:00 +0100)
commitc8540f7437a4d432f8cb51fa3278a037e713699f
tree15ee07d9e4d0f5dc401caeb77431e5cb05c17eea
parent1f562687e3c62a50f956d68ab58bfe130df9fbe9
BUG/MINOR: ssl: remove dead code in ssl_sock_from_buf()

When haproxy is compiled in -O0, the SSL_get_max_early_data() symbol is
used in the generated assembly, however -O2 seems to remove this symbol
when optimizing the code.

It happens because `if conn_is_back(conn)` and `if
(objt_listener(conn->target))` are opposed conditions, which mean we
never use the branch when objt_listener(conn->target) is true.

This patch removes the dead code. Bonus: SSL_get_max_early_data() is not
implemented in rustls, and that's the only thing preventing to start
with it.

This can be backported in every stable branches.
src/ssl_sock.c