mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2026-11-28 00:34:15 +00:00
Bound WebSocket upgrade handshake duration (#722)
* Bound WebSocket upgrade handshake duration * Document changed function contracts
This commit is contained in:
1 parent
134008e0e9
commit
474fbc7de4
2 files changed
+4
-2
No files matched your search
+2
-1
@@ -419,6 +419,7 @@ async fn handle_connection(
|
||||
});
|
||||
}
|
||||
|
||||
/// Prepares a TCP or WebSocket relay stream and begins pairing.
|
||||
async fn make_pair(
|
||||
stream: TcpStream,
|
||||
mut addr: SocketAddr,
|
||||
@@ -452,7 +453,7 @@ async fn make_pair(
|
||||
}
|
||||
Ok(response)
|
||||
};
|
||||
let ws_stream = tokio_tungstenite::accept_hdr_async(stream, callback).await?;
|
||||
let ws_stream = timeout(30_000, tokio_tungstenite::accept_hdr_async(stream, callback)).await??;
|
||||
make_pair_(ws_stream, addr, key, limiter).await;
|
||||
} else {
|
||||
make_pair_(FramedStream::from(stream, addr), addr, key, limiter).await;
|
||||
|
||||
Reference in new issue
Block a user