mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
fix: fail fast if IMAP FETCH cannot be parsed
Otherwise when connection is lost IMAP may get into infinite loop trying to parse remaining bytes: 11-21 18:00:48.442 14858 12946 W DeltaChat: src/imap.rs:1457: Failed to process IMAP FETCH result: io: bytes remaining in stream. 11-21 18:00:48.442 14858 12946 W DeltaChat: src/imap.rs:1457: Failed to process IMAP FETCH result: io: bytes remaining in stream. 11-21 18:00:48.442 14858 12946 W DeltaChat: src/imap.rs:1457: Failed to process IMAP FETCH result: io: bytes remaining in stream. 11-21 18:00:48.442 14858 12946 W DeltaChat: src/imap.rs:1457: Failed to process IMAP FETCH result: io: bytes remaining in stream. 11-21 18:00:48.442 14858 12946 W DeltaChat: src/imap.rs:1457: Failed to process IMAP FETCH result: io: bytes remaining in stream. 11-21 18:00:48.442 14858 12946 W DeltaChat: src/imap.rs:1457: Failed to process IMAP FETCH result: io: bytes remaining in stream. Returning an error bubbles it up to `fetch_idle()` which will call `trigger_reconnect()` and drop the connection.
This commit is contained in:
@@ -1451,13 +1451,8 @@ impl Imap {
|
|||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
let next_fetch_response = match next_fetch_response {
|
let next_fetch_response =
|
||||||
Ok(next_fetch_response) => next_fetch_response,
|
next_fetch_response.context("Failed to process IMAP FETCH result")?;
|
||||||
Err(err) => {
|
|
||||||
warn!(context, "Failed to process IMAP FETCH result: {}.", err);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Some(next_uid) = next_fetch_response.uid {
|
if let Some(next_uid) = next_fetch_response.uid {
|
||||||
if next_uid == request_uid {
|
if next_uid == request_uid {
|
||||||
|
|||||||
Reference in New Issue
Block a user