mirror of
https://github.com/chatmail/core.git
synced 2026-05-25 17:56:31 +03:00
fix(imap): only interrupt existing idle connection
This commit is contained in:
@@ -1027,6 +1027,8 @@ impl Imap {
|
||||
}
|
||||
|
||||
pub fn interrupt_idle(&self) {
|
||||
// only kill the connection, if we are actually ideling
|
||||
if self.session.lock().unwrap().0.is_none() {
|
||||
if let Some(ref mut stream) = self.session.lock().unwrap().1 {
|
||||
match stream.shutdown(net::Shutdown::Both) {
|
||||
Ok(_) => {}
|
||||
@@ -1035,7 +1037,9 @@ impl Imap {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// interrupt fake idle
|
||||
let &(ref lock, ref cvar) = &*self.watch.clone();
|
||||
let mut watch = lock.lock().unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user