1
0

fix wrong packet length calculation

This commit is contained in:
EAimTY 2023-05-30 19:05:53 +09:00
parent e1c54c065c
commit cf4ce32afa

View File

@ -233,7 +233,7 @@ impl Connection<side::Client> {
if let Some(pkt) = self.model.recv_packet(pkt) {
let pos = dg.position() as usize;
let mut buf = dg.into_inner();
if (pos + pkt.size() as usize) < buf.len() {
if (pos + pkt.size() as usize) <= buf.len() {
buf = buf.slice(pos..pos + pkt.size() as usize);
Ok(Task::Packet(Packet::new(pkt, PacketSource::Native(buf))))
} else {