dirty shutdown

This commit is contained in:
Lev Kokotov
2023-04-30 08:23:30 -07:00
parent bba5f10be1
commit f0d1916a98

View File

@@ -1084,13 +1084,13 @@ impl Drop for Server {
// Update statistics // Update statistics
self.stats.disconnect(); self.stats.disconnect();
let mut bytes = BytesMut::with_capacity(4); let mut bytes = BytesMut::with_capacity(5);
bytes.put_u8(b'X'); bytes.put_u8(b'X');
bytes.put_i32(4); bytes.put_i32(4);
match self.stream.get_mut().try_write(&bytes) { match self.stream.get_mut().try_write(&bytes) {
Ok(_) => (), Ok(5) => (),
Err(_) => debug!("Dirty shutdown"), _ => debug!("Dirty shutdown"),
}; };
// Should not matter. // Should not matter.