This commit is contained in:
Toshit Chawda 2024-11-24 21:10:08 -08:00
parent 3cef68d164
commit 13f282160b
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
17 changed files with 482 additions and 65 deletions

View file

@ -191,6 +191,7 @@ impl ProtocolExtension for CertAuthProtocolExtension {
async fn handle_packet(
&mut self,
_: u8,
_: Bytes,
_: &mut DynWebSocketRead,
_: &dyn LockingWebSocketWrite,

View file

@ -112,6 +112,7 @@ pub trait ProtocolExtension: std::fmt::Debug + Sync + Send + 'static {
/// Handle receiving a packet.
async fn handle_packet(
&mut self,
packet_type: u8,
packet: Bytes,
read: &mut DynWebSocketRead,
write: &dyn LockingWebSocketWrite,

View file

@ -56,6 +56,7 @@ impl ProtocolExtension for MotdProtocolExtension {
async fn handle_packet(
&mut self,
_: u8,
_: Bytes,
_: &mut DynWebSocketRead,
_: &dyn LockingWebSocketWrite,

View file

@ -102,6 +102,7 @@ impl ProtocolExtension for PasswordProtocolExtension {
async fn handle_packet(
&mut self,
_: u8,
_: Bytes,
_: &mut DynWebSocketRead,
_: &dyn LockingWebSocketWrite,

View file

@ -48,6 +48,7 @@ impl ProtocolExtension for UdpProtocolExtension {
async fn handle_packet(
&mut self,
_: u8,
_: Bytes,
_: &mut DynWebSocketRead,
_: &dyn LockingWebSocketWrite,

View file

@ -189,7 +189,7 @@ impl<R: WebSocketRead + 'static, W: WebSocketWrite + 'static> MuxInner<R, W> {
let (ch_tx, ch_rx) = mpsc::bounded(if self.role == Role::Server {
self.buffer_size as usize
} else {
usize::MAX
usize::MAX - 8
});
let should_flow_control = self.tcp_extensions.contains(&stream_type.into());

View file

@ -572,6 +572,7 @@ impl<'a> Packet<'a> {
{
extension
.handle_packet(
packet_type,
BytesMut::from(bytes).freeze(),
DynWebSocketRead::from_mut(read),
write,