libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

commit f38e7e401746efb87a3be7df6a7df223fb1eb642
parent 336517d01ce8414d81c71f00a0fa16b54bb26ca8
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date:   Thu, 29 Oct 2026 22:25:39 +0100

Fixed the return status for TLS session connection info

MHD_connection_get_info_dynamic_sz() populated the requested TLS session
information but then fell through and returned
MHD_SC_INFO_GET_TYPE_UNKNOWN.

Returned MHD_SC_OK after retrieving the TLS session.

Based on a report and patch by Sami Jawhar on the mailing list.

Diffstat:
Msrc/mhd2/conn_get_info.c | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/mhd2/conn_get_info.c b/src/mhd2/conn_get_info.c @@ -173,13 +173,12 @@ MHD_connection_get_info_dynamic_sz ( return MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE; if (sizeof(output_buf->v_tls_session) > output_buf_size) return MHD_SC_INFO_GET_BUFF_TOO_SMALL; -#ifndef MHD_SUPPORT_HTTPS - mhd_UNREACHABLE (); - return MHD_SC_INTERNAL_ERROR; -#else /* MHD_SUPPORT_HTTPS */ +#ifdef MHD_SUPPORT_HTTPS mhd_tls_conn_get_tls_sess (connection->tls, &(output_buf->v_tls_session)); +#else /* MHD_SUPPORT_HTTPS */ + mhd_UNREACHABLE (); #endif /* MHD_SUPPORT_HTTPS */ - break; + return MHD_SC_OK; case MHD_CONNECTION_INFO_DYNAMIC_SENTINEL: default: break;