mirror of
https://git.meli.delivery/meli/meli
synced 2024-11-19 03:25:38 +00:00
imap: don't retry command on reconnection
If a command fails and connection is restarted, don't try the command again; it only made sense in the previous connection's context.
This commit is contained in:
parent
e3abd458ce
commit
9a46e58029
@ -398,13 +398,10 @@ impl ImapConnection {
|
|||||||
} else {
|
} else {
|
||||||
*self.online.lock().unwrap() = (Instant::now(), Ok(()));
|
*self.online.lock().unwrap() = (Instant::now(), Ok(()));
|
||||||
}
|
}
|
||||||
let (capabilities, mut stream) = new_stream?;
|
let (capabilities, stream) = new_stream?;
|
||||||
let ret = action(&mut stream);
|
self.stream = Ok(stream);
|
||||||
if ret.is_ok() {
|
self.capabilities = capabilities;
|
||||||
self.stream = Ok(stream);
|
Err(MeliError::new("Connection timed out"))
|
||||||
self.capabilities = capabilities;
|
|
||||||
}
|
|
||||||
ret
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,7 +473,7 @@ impl Iterator for ImapBlockingConnection {
|
|||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
match conn.stream.as_mut().unwrap().stream.read(buf) {
|
match conn.stream.as_mut().unwrap().stream.read(buf) {
|
||||||
Ok(0) => continue,
|
Ok(0) => return None,
|
||||||
Ok(b) => {
|
Ok(b) => {
|
||||||
result.extend_from_slice(&buf[0..b]);
|
result.extend_from_slice(&buf[0..b]);
|
||||||
debug!(unsafe { std::str::from_utf8_unchecked(result) });
|
debug!(unsafe { std::str::from_utf8_unchecked(result) });
|
||||||
|
Loading…
Reference in New Issue
Block a user