only use nc if end packet message is empty
This commit is contained in:
parent
c9d30bb299
commit
4a191a5652
@ -183,8 +183,10 @@ pub async fn connection_handler(
|
||||
if packet.kind() == PacketKind::End {
|
||||
packet.header.kind = PacketKind::Reject.raw();
|
||||
packet.data.clear();
|
||||
packet.data.extend_from_slice(b"nc\0");
|
||||
packet.header.length = packet.data.len() as u8;
|
||||
if packet.data.is_empty() {
|
||||
packet.data.extend_from_slice(b"nc\0");
|
||||
packet.header.length = packet.data.len() as u8;
|
||||
}
|
||||
}
|
||||
|
||||
port_handler.lock().await.start_rejector(
|
||||
|
Loading…
Reference in New Issue
Block a user