commit b37d4d7d9fdb2dfdf3976377765a1de316a6d925
parent 6fc97075722341824d2bbec2bc6bf93697b22333
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Tue, 9 Dec 2025 18:51:29 +0100
mhd_send: disabled log messages for sockets function to prevent potential log flood
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/mhd2/mhd_send.c b/src/mhd2/mhd_send.c
@@ -242,11 +242,13 @@ mhd_connection_set_nodelay_state (struct MHD_Connection *connection,
{
connection->sk.props.is_nonip = mhd_T_YES;
}
+#if 0 /* No messages, avoid potential message flood in the log */
else
{
mhd_LOG_MSG (connection->daemon, MHD_SC_SOCKET_TCP_NODELAY_FAILED, \
"Failed to set required TCP_NODELAY option for the socket.");
}
+#endif /* No messages */
#else /* ! TCP_NODELAY */
(void) nodelay_state; /* Mute compiler warnings */
connection->sk.state.nodelay = mhd_T_NO;
@@ -285,6 +287,7 @@ mhd_connection_set_cork_state (struct MHD_Connection *connection,
{
connection->sk.props.is_nonip = mhd_T_YES;
}
+#if 0 /* No messages, avoid potential message flood in the log */
else
{
# ifdef TCP_CORK
@@ -295,6 +298,7 @@ mhd_connection_set_cork_state (struct MHD_Connection *connection,
"Failed to set required TCP_NOPUSH option for the socket.");
# endif
}
+#endif /* No messages */
#else /* ! mhd_TCP_CORK_NOPUSH */
(void) cork_state; /* Mute compiler warnings. */
@@ -577,8 +581,10 @@ zero_send (struct MHD_Connection *connection)
mhd_assert (mhd_T_IS_YES (connection->sk.state.nodelay));
if (0 == mhd_sys_send (connection->sk.fd, &dummy, 0))
return true;
+#if 0 /* No messages, avoid potential message flood in the log */
mhd_LOG_MSG (connection->daemon, MHD_SC_SOCKET_ZERO_SEND_FAILED, \
"Failed to push the data by zero-sized send.");
+#endif /* No messages */
return false;
}
@@ -761,11 +767,14 @@ post_send_setopt (struct MHD_Connection *connection,
/* Failed to push the data. */
#endif /* ! mhd_TCP_CORK_NOPUSH */
+
+#if 0 /* No messages, avoid potential message flood in the log */
mhd_LOG_MSG (connection->daemon, MHD_SC_SOCKET_FLUSH_LAST_PART_FAILED, \
"Failed to force flush the last part of the response header " \
"or the response content that might have been buffered by " \
"the kernel. The client may experience some delay (usually " \
"in range 200ms - 5 sec).");
+#endif /* No messages */
return;
}