* if this doesn't help either, disconnect client. */
CLIENT *c;
CONN_ID i;
+ char msg[64];
for (i = 0; i < Pool_Size; i++) {
if (My_Connections[i].sock < 0)
LogDebug
("Connection %d: Ping timeout: %d seconds.",
i, Conf_PongTimeout);
- Conn_Close(i, NULL, "Ping timeout",
- true);
+ snprintf(msg, sizeof(msg), "Ping timeout: %d seconds", Conf_PongTimeout);
+ Conn_Close(i, NULL, msg, true);
}
} else if (My_Connections[i].lastdata <
time(NULL) - Conf_PingTimeout) {
GLOBAL bool
Conn_GetCipherInfo(CONN_ID Idx, char *buf, size_t len)
{
+ if (Idx < 0)
+ return false;
+ assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION)));
return ConnSSL_GetCipherInfo(&My_Connections[Idx], buf, len);
}
GLOBAL bool
Conn_UsesSSL(CONN_ID Idx)
{
+ if (Idx < 0)
+ return false;
+ assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION)));
return Conn_OPTION_ISSET(&My_Connections[Idx], CONN_SSL);
}
#endif