Reset instead of discard all (#549)

* Use reset all instead of discard all

* Move 'X' handling to before admin handle

* fix tests
This commit is contained in:
Zain Kabani
2023-08-16 13:08:48 -04:00
committed by GitHub
parent 4f0f45b576
commit bb27586758
3 changed files with 35 additions and 26 deletions

View File

@@ -821,6 +821,14 @@ where
message_result = read_message(&mut self.read) => message_result?
};
if message[0] as char == 'X' {
debug!("Client disconnecting");
self.stats.disconnect();
return Ok(());
}
// Handle admin database queries.
if self.admin {
debug!("Handling admin command");
@@ -940,14 +948,6 @@ where
continue;
}
'X' => {
debug!("Client disconnecting");
self.stats.disconnect();
return Ok(());
}
// Close (F)
'C' => {
if prepared_statements_enabled {