Ping only websocket connections

This commit is contained in:
Sergey Lyubka 2014-01-09 10:37:17 +00:00
parent 15a2639355
commit 4cd11de400

View File

@ -3467,7 +3467,9 @@ unsigned int mg_poll_server(struct mg_server *server, int milliseconds) {
// Close expired connections and those that need to be closed
LINKED_LIST_FOREACH(&server->active_connections, lp, tmp) {
conn = LINKED_LIST_ENTRY(lp, struct connection, link);
ping_idle_websocket_connection(conn, current_time);
if (conn->mg_conn.is_websocket) {
ping_idle_websocket_connection(conn, current_time);
}
if (conn->flags & CONN_CLOSE || conn->last_activity_time < expire_time) {
close_conn(conn);
}