[geary/mjog/imap-command-cancellation: 4/6] Geary.Imap.Command: Rename cancel_send to something that better describes it




commit 6c0607d8092340256f3f3b1902fad1abda57e4d4
Author: Michael Gratton <mike vee net>
Date:   Tue Sep 1 23:14:28 2020 +1000

    Geary.Imap.Command: Rename cancel_send to something that better describes it
    
    This method doesn't cancel sending as much as it halts any serialisation
    that is occurring.

 src/engine/imap/command/imap-authenticate-command.vala |  6 +++---
 src/engine/imap/command/imap-command.vala              | 16 ++++++++--------
 src/engine/imap/command/imap-idle-command.vala         |  4 ++--
 3 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/src/engine/imap/command/imap-authenticate-command.vala 
b/src/engine/imap/command/imap-authenticate-command.vala
index a7a0c1866..1ed075beb 100644
--- a/src/engine/imap/command/imap-authenticate-command.vala
+++ b/src/engine/imap/command/imap-authenticate-command.vala
@@ -93,7 +93,7 @@ public class Geary.Imap.AuthenticateCommand : Command {
         } else {
             if (this.method != AuthenticateCommand.OAUTH2_METHOD ||
                 this.response_literal != null) {
-                cancel_send();
+                stop_serialisation();
                 throw new ImapError.INVALID(
                     "Unexpected AUTHENTICATE continuation request"
                 );
@@ -112,8 +112,8 @@ public class Geary.Imap.AuthenticateCommand : Command {
         }
     }
 
-    protected override void cancel_send() {
-        base.cancel_send();
+    protected override void stop_serialisation() {
+        base.stop_serialisation();
         this.error_cancellable.cancel();
     }
 
diff --git a/src/engine/imap/command/imap-command.vala b/src/engine/imap/command/imap-command.vala
index 94d877620..702ce1af8 100644
--- a/src/engine/imap/command/imap-command.vala
+++ b/src/engine/imap/command/imap-command.vala
@@ -315,7 +315,7 @@ public abstract class Geary.Imap.Command : BaseObject {
     internal virtual void completed(StatusResponse new_status)
         throws ImapError {
         if (this.status != null) {
-            cancel_send();
+            stop_serialisation();
             throw new ImapError.SERVER_ERROR(
                 "%s: Duplicate status response received: %s",
                 to_brief_string(),
@@ -326,7 +326,7 @@ public abstract class Geary.Imap.Command : BaseObject {
         this.status = new_status;
         this.response_timer.reset();
         this.complete_lock.blind_notify();
-        cancel_send();
+        stop_serialisation();
 
         check_has_status();
     }
@@ -348,7 +348,7 @@ public abstract class Geary.Imap.Command : BaseObject {
     internal virtual void data_received(ServerData data)
         throws ImapError {
         if (this.status != null) {
-            cancel_send();
+            stop_serialisation();
             throw new ImapError.SERVER_ERROR(
                 "%s: Server data received when command already complete: %s",
                 to_brief_string(),
@@ -370,7 +370,7 @@ public abstract class Geary.Imap.Command : BaseObject {
         continuation_requested(ContinuationResponse continuation)
         throws ImapError {
         if (this.status != null) {
-            cancel_send();
+            stop_serialisation();
             throw new ImapError.SERVER_ERROR(
                 "%s: Continuation requested when command already complete",
                 to_brief_string()
@@ -378,7 +378,7 @@ public abstract class Geary.Imap.Command : BaseObject {
         }
 
         if (this.literal_spinlock == null) {
-            cancel_send();
+            stop_serialisation();
             throw new ImapError.SERVER_ERROR(
                 "%s: Continuation requested but no literals available",
                 to_brief_string()
@@ -395,19 +395,19 @@ public abstract class Geary.Imap.Command : BaseObject {
     }
 
     /**
-     * Cancels any existing serialisation in progress.
+     * Stops any existing serialisation in progress.
      *
      * When this method is called, any non I/O related process
      * blocking the blocking {@link send} must be cancelled.
      */
-    protected virtual void cancel_send() {
+    protected virtual void stop_serialisation() {
         if (this.literal_cancellable != null) {
             this.literal_cancellable.cancel();
         }
     }
 
     private void cancel(ImapError cause) {
-        cancel_send();
+        stop_serialisation();
         this.cancelled_cause = cause;
         this.response_timer.reset();
         this.complete_lock.blind_notify();
diff --git a/src/engine/imap/command/imap-idle-command.vala b/src/engine/imap/command/imap-idle-command.vala
index df36b2df8..5c7280895 100644
--- a/src/engine/imap/command/imap-idle-command.vala
+++ b/src/engine/imap/command/imap-idle-command.vala
@@ -88,8 +88,8 @@ public class Geary.Imap.IdleCommand : Command {
         }
     }
 
-    protected override void cancel_send() {
-        base.cancel_send();
+    protected override void stop_serialisation() {
+        base.stop_serialisation();
         this.exit_cancellable.cancel();
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]