diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-06-28 15:52:55 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-06-28 15:52:55 +0200 |
commit | 9979671b001ccb25917da7091d13ad3fc1096330 (patch) | |
tree | f59d9a63cd3626a584df129bedeac9804be4ca24 | |
parent | 06b888d9696cf7270c6daff4d5ae8a0591e265fe (diff) | |
download | aerogramme-quentin.tar.gz aerogramme-quentin.zip |
Try my best to close the connectionquentin
-rw-r--r-- | src/imap/session.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/imap/session.rs b/src/imap/session.rs index 2fa413e..30885d1 100644 --- a/src/imap/session.rs +++ b/src/imap/session.rs @@ -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 |