diff --git a/src/mhd2/daemon_add_conn.c b/src/mhd2/daemon_add_conn.c index 6635fd5f..2782aba7 100644 --- a/src/mhd2/daemon_add_conn.c +++ b/src/mhd2/daemon_add_conn.c @@ -171,7 +171,7 @@ new_connection_prepare_ (struct MHD_Daemon *restrict daemon, tls_data_size = 0; #ifdef MHD_ENABLE_HTTPS if (mhd_D_HAS_TLS (daemon)) - tls_data_size = mhd_tls_conn_get_tls_size (); + tls_data_size = mhd_tls_conn_get_tls_size (daemon->tls); #endif c = mhd_calloc (1, sizeof (struct MHD_Connection) + tls_data_size); diff --git a/src/mhd2/mhd_tls_choice.h b/src/mhd2/mhd_tls_choice.h index d6ec6ddf..a07aa467 100644 --- a/src/mhd2/mhd_tls_choice.h +++ b/src/mhd2/mhd_tls_choice.h @@ -92,7 +92,7 @@ (mhd_TLS_GNU_ENABLED + mhd_TLS_OPEN_ENABLED) #if mhd_TLS_NUM_BACKENDS == 0 -#error At least one TLS backend must be enabled is this header is included +#error At least one TLS backend must be enabled if this header is included #endif #if mhd_TLS_NUM_BACKENDS > 1 diff --git a/src/mhd2/mhd_tls_funcs.h b/src/mhd2/mhd_tls_funcs.h index a2d0c7b5..1d2c0654 100644 --- a/src/mhd2/mhd_tls_funcs.h +++ b/src/mhd2/mhd_tls_funcs.h @@ -103,9 +103,10 @@ /** * Get size size of the connection's TLS settings + * @param d_tls the pointer to the daemon's TLS settings */ -#define mhd_tls_conn_get_tls_size() \ - mhd_TLS_FUNC (_conn_get_tls_size)() +#define mhd_tls_conn_get_tls_size(d_tls) \ + mhd_TLS_FUNC (_conn_get_tls_size)(d_tls) /** * Initialise connection TLS settings diff --git a/src/mhd2/tls_gnu_funcs.c b/src/mhd2/tls_gnu_funcs.c index 4741f9d1..d4345a98 100644 --- a/src/mhd2/tls_gnu_funcs.c +++ b/src/mhd2/tls_gnu_funcs.c @@ -450,7 +450,7 @@ mhd_tls_gnu_daemon_deinit (struct mhd_TlsGnuDaemonData *restrict d_tls) /* ** Connection initialisation / de-initialisation ** */ MHD_INTERNAL size_t -mhd_tls_gnu_conn_get_tls_size (void) +mhd_tls_gnu_conn_get_tls_size_v (void) { return sizeof (struct mhd_TlsGnuConnData); } diff --git a/src/mhd2/tls_gnu_funcs.h b/src/mhd2/tls_gnu_funcs.h index 3d593dc9..390ccff6 100644 --- a/src/mhd2/tls_gnu_funcs.h +++ b/src/mhd2/tls_gnu_funcs.h @@ -117,7 +117,14 @@ struct mhd_ConnSocket; /* Forward declaration */ * Get size size of the connection's TLS settings */ MHD_INTERNAL size_t -mhd_tls_gnu_conn_get_tls_size (void); +mhd_tls_gnu_conn_get_tls_size_v (void); + +/** + * Get size size of the connection's TLS settings + * @param d_tls the pointer to the daemon's TLS settings + */ +#define mhd_tls_gnu_conn_get_tls_size(d_tls) \ + mhd_tls_gnu_conn_get_tls_size_v () /** * Initialise connection TLS settings diff --git a/src/mhd2/tls_open_funcs.c b/src/mhd2/tls_open_funcs.c index cfe1af2f..be18d5c5 100644 --- a/src/mhd2/tls_open_funcs.c +++ b/src/mhd2/tls_open_funcs.c @@ -796,7 +796,7 @@ mhd_tls_open_daemon_deinit (struct mhd_TlsOpenDaemonData *restrict d_tls) /* ** Connection initialisation / de-initialisation ** */ MHD_INTERNAL size_t -mhd_tls_open_conn_get_tls_size (void) +mhd_tls_open_conn_get_tls_size_v (void) { return sizeof (struct mhd_TlsOpenConnData); } diff --git a/src/mhd2/tls_open_funcs.h b/src/mhd2/tls_open_funcs.h index 12d29a5f..7942727d 100644 --- a/src/mhd2/tls_open_funcs.h +++ b/src/mhd2/tls_open_funcs.h @@ -112,7 +112,14 @@ struct mhd_ConnSocket; /* Forward declaration */ * Get size size of the connection's TLS settings */ MHD_INTERNAL size_t -mhd_tls_open_conn_get_tls_size (void); +mhd_tls_open_conn_get_tls_size_v (void); + +/** + * Get size size of the connection's TLS settings + * @param d_tls the pointer to the daemon's TLS settings + */ +#define mhd_tls_open_conn_get_tls_size(d_tls) \ + mhd_tls_open_conn_get_tls_size_v () /** * Initialise connection TLS settings