Add a 10-second timeout for outgoing auth requests to prevent
connections from getting stuck when the remote peer goes silent
after the hello handshake but before responding to auth.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!network_auth_valid(sock_data.name, sock_data.id, msg.token))
return;
+ if (sock_data.timer)
+ sock_data.timer.cancel();
sock_data.auth = true;
core.dbg(`Outgoing connection to ${name} established\n`);
data_cb: auth_data_cb,
cb: auth_cb,
});
+ sock_data.timer = uloop.timer(10 * 1000, () => {
+ network_tx_socket_close(sock_data);
+ });
return 0;
};