remove a bunch of allocations from packet encode, drop rogue clients' packets

This commit is contained in:
Toshit Chawda 2024-04-27 22:05:25 -07:00
parent ce2660943a
commit 855fa610ed
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
3 changed files with 77 additions and 74 deletions

View file

@ -381,7 +381,7 @@ impl MuxInner {
}
Data(data) => {
if let Some(stream) = self.stream_map.get(&packet.stream_id) {
let _ = stream.stream.send_async(data).await;
let _ = stream.stream.try_send(data);
if stream.stream_type == StreamType::Tcp {
stream.flow_control.store(
stream