mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-08-24 06:18:28 -04:00
reject connections with invalid framing
This commit is contained in:
parent
29397a35eb
commit
a25dbf9336
1 changed files with 8 additions and 0 deletions
|
@ -151,6 +151,14 @@ impl RawTcpProtocolHandler {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure this has a chance of being proper framed, otherwise drop the connection
|
||||||
|
// This will keep upgraded WS->WSS TLS negotiations from getting punished if the
|
||||||
|
// WSS accept handler isn't enabled
|
||||||
|
if peekbuf[0] != b'V' || peekbuf[1] != b'L' {
|
||||||
|
// Not framed TCP, drop it
|
||||||
|
return Ok(None);
|
||||||
|
}
|
||||||
|
|
||||||
let peer_addr = PeerAddress::new(
|
let peer_addr = PeerAddress::new(
|
||||||
SocketAddress::from_socket_addr(socket_addr),
|
SocketAddress::from_socket_addr(socket_addr),
|
||||||
ProtocolType::TCP,
|
ProtocolType::TCP,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue