[geary/wip/26-proton-mail-bridge] Don't flag as not in when de-idling IDLE until we actually receive OK.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/26-proton-mail-bridge] Don't flag as not in when de-idling IDLE until we actually receive OK.
- Date: Thu, 5 Jul 2018 01:51:08 +0000 (UTC)
commit 6524a30e11905ca5d75cec3bf0b203e1697ef88a
Author: Michael James Gratton <mike vee net>
Date: Thu Jul 5 11:50:29 2018 +1000
Don't flag as not in when de-idling IDLE until we actually receive OK.
This prevents the IMAP client session from sending pending commands while
de-idleing, since per RFC 3501 sections 2.2.1 and 5.5, the client should
wait for the IDLE command to be completed before sending another command.
* src/engine/imap/transport/imap-client-connection.vala (Connection):
Don't call signal_left_idle when de-idling, only when the IDLE command
is complete. Strengthen notion of strict is-idling to include when
de-idling.
.../imap/transport/imap-client-connection.vala | 28 +++++++++++-----------
1 file changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/src/engine/imap/transport/imap-client-connection.vala
b/src/engine/imap/transport/imap-client-connection.vala
index 1b9eb635..b000afff 100644
--- a/src/engine/imap/transport/imap-client-connection.vala
+++ b/src/engine/imap/transport/imap-client-connection.vala
@@ -340,25 +340,29 @@ public class Geary.Imap.ClientConnection : BaseObject {
return null;
}
-
+
/**
- * Returns true if the connection is in an IDLE state. The or_idling parameter means to return
- * true if the connection is working toward an IDLE state (but additional responses are being
- * returned from the server before getting there).
+ * Determines if the connection is in an IDLE state.
+ *
+ * The strict parameter means to return true if the connection is
+ * working toward an IDLE state (but additional responses are
+ * being returned from the server before getting there) or is
+ * leaving IDLE.
*/
- public bool is_in_idle(bool or_idling) {
+ public bool is_in_idle(bool strict) {
switch (fsm.get_state()) {
case State.IDLE:
return true;
-
+
case State.IDLING:
- return or_idling;
-
+ case State.DEIDLING:
+ return strict;
+
default:
return false;
}
}
-
+
public bool install_send_converter(Converter converter) {
return ser.install_converter(converter);
}
@@ -1031,11 +1035,7 @@ public class Geary.Imap.ClientConnection : BaseObject {
return do_no_proceed(state, user);
}
-
- // only signal leaving IDLE state if that's the case
- if (state == State.IDLE)
- fsm.do_post_transition(signal_left_idle);
-
+
return do_proceed(State.DEIDLING, user);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]