mirror of
https://github.com/chatmail/core.git
synced 2026-05-21 07:46: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) {
|
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 {
|
if let Some(ref mut stream) = self.session.lock().unwrap().1 {
|
||||||
match stream.shutdown(net::Shutdown::Both) {
|
match stream.shutdown(net::Shutdown::Both) {
|
||||||
Ok(_) => {}
|
Ok(_) => {}
|
||||||
@@ -1035,7 +1037,9 @@ impl Imap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// interrupt fake idle
|
||||||
let &(ref lock, ref cvar) = &*self.watch.clone();
|
let &(ref lock, ref cvar) = &*self.watch.clone();
|
||||||
let mut watch = lock.lock().unwrap();
|
let mut watch = lock.lock().unwrap();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user