Try my best to close the connection

This commit is contained in:
Quentin 2022-06-28 15:52:55 +02:00
parent 06b888d969
commit 9979671b00
Signed by: quentin
GPG Key ID: E9602264D639FF68
1 changed files with 5 additions and 1 deletions

View File

@ -52,7 +52,7 @@ impl Manager {
return async { Response::bad("Too fast! Send less pipelined requests.") }.boxed()
}
Err(TrySendError::Closed(_)) => {
return async { Response::bad("Session task has existed.") }.boxed()
return async { Err(BalError::Text("Terminated session".to_string())) }.boxed()
}
};
@ -147,6 +147,10 @@ impl Instance {
msg.tx.send(res).unwrap_or_else(|e| {
tracing::warn!("failed to send imap response to manager: {:#?}", e)
});
if let flow::State::Logout = &self.state {
break;
}
}
//@FIXME add more info about the runner