Переглянути джерело

Corrected internal API for TLS backends

Evgeny Grin (Karlson2k) 1 рік тому
батько
коміт
155895fe45

+ 1 - 1
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);

+ 1 - 1
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

+ 3 - 2
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

+ 1 - 1
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);
 }

+ 8 - 1
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

+ 1 - 1
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);
 }

+ 8 - 1
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