commit 2d3259b43cc9e90e4f40e3786871e3f857ea9b06
parent 4c39a988c3671e1a408958fa9ee07aa7b5c041db
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Tue, 9 Dec 2025 19:01:33 +0100
mhd_send: added asserts
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/mhd2/mhd_send.c b/src/mhd2/mhd_send.c
@@ -235,6 +235,11 @@ mhd_connection_set_nodelay_state (struct mhd_ConnSocket *restrict sk,
if (mhd_T_IS_YES (sk->props.is_nonip))
return false;
+#ifndef mhd_NODELAY_SET_PUSH_DATA_ALWAYS
+ mhd_assert ((! nodelay_state) || (mhd_T_IS_NOT_YES (sk->state.nodelay)));
+#endif /* mhd_NODELAY_SET_PUSH_DATA_ALWAYS */
+ mhd_assert ((nodelay_state) || (mhd_T_IS_NOT_NO (sk->state.nodelay)));
+
if (0 == mhd_setsockopt (sk->fd,
IPPROTO_TCP,
TCP_NODELAY,
@@ -290,6 +295,11 @@ mhd_connection_set_cork_state (struct mhd_ConnSocket *restrict sk,
if (mhd_T_IS_YES (sk->props.is_nonip))
return false;
+ mhd_assert ((! cork_state) || (mhd_T_IS_NOT_YES (sk->state.corked)));
+#ifndef mhd_CORK_RESET_PUSH_DATA_ALWAYS
+ mhd_assert ((cork_state) || (mhd_T_IS_NOT_NO (sk->state.corked)));
+#endif /* mhd_CORK_RESET_PUSH_DATA_ALWAYS */
+
if (0 == mhd_setsockopt (sk->fd,
IPPROTO_TCP,
mhd_TCP_CORK_NOPUSH,