fix connection loss when traffic is huge

This commit is contained in:
sijie.sun
2024-09-26 21:59:17 +08:00
committed by Sijie.Sun
parent 7b4a01e7fb
commit 2496cf51c3
6 changed files with 54 additions and 36 deletions

View File

@@ -500,6 +500,12 @@ impl ZCPacket {
pub fn mut_inner(&mut self) -> &mut BytesMut {
&mut self.inner
}
pub fn is_lossy(&self) -> bool {
self.peer_manager_header()
.and_then(|hdr| Some(hdr.packet_type == PacketType::Data as u8))
.unwrap_or(false)
}
}
#[cfg(test)]