Depending on the stack size, too many clients on the same channel
quitting at the same time would trigger a crash due to too many
recursive calls to Conn_Close().
if (errno == EAGAIN || errno == EINTR)
return true;
if (errno == EAGAIN || errno == EINTR)
return true;
+ /* Log write errors but do not close the connection yet.
+ * Calling Conn_Close() now could result in too many recursive calls.
+ */
if (!Conn_OPTION_ISSET(&My_Connections[Idx], CONN_ISCLOSING))
Log(LOG_ERR,
"Write error on connection %d (socket %d): %s!",
if (!Conn_OPTION_ISSET(&My_Connections[Idx], CONN_ISCLOSING))
Log(LOG_ERR,
"Write error on connection %d (socket %d): %s!",
else
LogDebug("Recursive write error on connection %d (socket %d): %s!",
Idx, My_Connections[Idx].sock, strerror(errno));
else
LogDebug("Recursive write error on connection %d (socket %d): %s!",
Idx, My_Connections[Idx].sock, strerror(errno));
- Conn_Close(Idx, "Write error", NULL, false);