fix pong read

This commit is contained in:
Toshit Chawda 2024-09-23 17:42:00 -07:00
parent 09b15e3c43
commit 2dfcb0021f
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
2 changed files with 5 additions and 0 deletions

View file

@ -27,6 +27,7 @@ pub(crate) enum WsEvent {
SendPong(Payload<'static>),
WispMessage(Option<Packet<'static>>, Option<Frame<'static>>),
EndFut(Option<CloseReason>),
Noop
}
struct MuxMapValue {
@ -238,6 +239,8 @@ impl<R: WebSocketRead + Send> MuxInner<R> {
return Ok(None);
} else if frame.opcode == OpCode::Ping {
return Ok(Some(WsEvent::SendPong(frame.payload)));
} else if frame.opcode == OpCode::Pong {
return Ok(Some(WsEvent::Noop));
}
if let Some(ref extra_frame) = optional_frame {
@ -342,6 +345,7 @@ impl<R: WebSocketRead + Send> MuxInner<R> {
}
}
}
WsEvent::Noop => {}
}
}