xlog("L_WARN", "websocket|log|$si:$sp is at the maximum $def(WS_MAX_CONNECTIONS_PER_IP) allowable sockets per IP, rejecting request for another websocket\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}
if (ws_handle_handshake()) {
$var(shtinc)=$shtinc(websockets=>$si::count);
xlog("L_INFO", "websocket|log|opened websocket $var(count) of 50 for $si:$sp\n");
$var(count)=$shtinc(websockets=>$si::count);
xlog("L_INFO", "websocket|log|opened websocket $var(count) of $def(WS_MAX_CONNECTIONS_PER_IP) for $si:$sp\n");
exit;
}
@ -103,10 +111,10 @@ event_route[xhttp:request]
}
event_route[websocket:closed] {
$var(shtdec)=$shtdec(websockets=>$si::count);
if ($sht(websockets=>$si::count) < 1) {
$var(count)=$shtdec(websockets=>$si::count);
if ($var(count) < 1) {
xlog("L_INFO", "websocket|log|$si:$sp closed last websocket to that IP\n");