unetmsg: ping on tx channel after new incoming connection
Ensure that stale connections are timed out faster Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
929702fdc5
commit
9bdbe24176
1 changed files with 11 additions and 1 deletions
|
@ -191,8 +191,18 @@ function network_check_auth(sock_data, info)
|
|||
sock_data.auth = true;
|
||||
net.rx_channels[sock_data.name] = sock_data;
|
||||
core.dbg(`Incoming connection from ${sock_data.name} established\n`);
|
||||
if (!net.tx_channels[sock_data.name])
|
||||
|
||||
let chan = net.tx_channels[sock_data.name];
|
||||
if (!chan) {
|
||||
net.timer.set(100);
|
||||
return;
|
||||
}
|
||||
|
||||
chan.channel.request({
|
||||
method: "ping",
|
||||
data: {},
|
||||
return: "ignore",
|
||||
});
|
||||
}
|
||||
|
||||
function network_accept(net, sock, addr)
|
||||
|
|
Loading…
Reference in a new issue