net: timeout on accept_async socket too

This commit is contained in:
dr-frmr 2023-11-22 16:31:32 -05:00
parent 11b1805d26
commit 72bb9a872f
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View File

@ -384,7 +384,7 @@ async fn direct_networking(
// to prevent some amount of potential DDoS attacks.
// can also block based on socket_addr
// ignore connections we failed to accept...?
if let Ok(websocket) = accept_async(MaybeTlsStream::Plain(stream)).await {
if let Ok(Ok(websocket)) = time::timeout(TIMEOUT, accept_async(MaybeTlsStream::Plain(stream))).await {
print_debug(&print_tx, "net: received new websocket connection").await;
let (peer_id, routing_for, conn) =
match time::timeout(TIMEOUT, recv_connection(

@ -1 +1 @@
Subproject commit 99759929dd38e515ad4f93ac98459af0e6180385
Subproject commit 7120168626f4e9b09008844174c63fc30af8711f