mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
cluster/websocket: Propagate code and reason to websocket_client_lost()
This allows to get visibility into the reason why ixwebsocket or the client decided to disconnect. Closed #4440
This commit is contained in:
parent
aaddeb19ad
commit
a61aff010f
11 changed files with 131 additions and 6 deletions
|
@ -680,10 +680,11 @@ event websocket_client_added(endpoint: EndpointInfo, subscriptions: string_vec)
|
|||
Cluster::log(msg);
|
||||
}
|
||||
|
||||
event websocket_client_lost(endpoint: EndpointInfo)
|
||||
event websocket_client_lost(endpoint: EndpointInfo, code: count, reason: string)
|
||||
{
|
||||
local msg = fmt("WebSocket client '%s' (%s:%d) gone",
|
||||
endpoint$id, endpoint$network$address, endpoint$network$bound_port);
|
||||
local msg = fmt("WebSocket client '%s' (%s:%d) gone with code %d%s",
|
||||
endpoint$id, endpoint$network$address, endpoint$network$bound_port, code,
|
||||
|reason| > 0 ? fmt(" and reason '%s'", reason) : "");
|
||||
Cluster::log(msg);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue