[geary/mjog/imap-connection-fixes: 41/42] Geary.Imap.ClientConnection: Simplify serisaliser buf handling



commit a461e8e1f48ab39417b46acbf2e9d00941ba2898
Author: Michael Gratton <mike vee net>
Date:   Fri Mar 13 10:31:07 2020 +1100

    Geary.Imap.ClientConnection: Simplify serisaliser buf handling
    
    Now that Serialiser isn't using a DataOutputStream, remove workarounds
    for glad-handling it.

 src/engine/imap/transport/imap-client-connection.vala | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/src/engine/imap/transport/imap-client-connection.vala 
b/src/engine/imap/transport/imap-client-connection.vala
index 57c537fb..71d8c0ef 100644
--- a/src/engine/imap/transport/imap-client-connection.vala
+++ b/src/engine/imap/transport/imap-client-connection.vala
@@ -67,7 +67,6 @@ public class Geary.Imap.ClientConnection : BaseObject, Logging.Source {
     private IOStream? cx = null;
     private Deserializer? deserializer = null;
     private Serializer? serializer = null;
-    private GLib.BufferedOutputStream? serializer_buffer = null;
 
     private int tag_counter = 0;
     private char tag_prefix = 'a';
@@ -315,11 +314,11 @@ public class Geary.Imap.ClientConnection : BaseObject, Logging.Source {
 
         string id = "%04d".printf(cx_id);
 
-        this.serializer_buffer = new GLib.BufferedOutputStream(
+        var serializer_buffer = new GLib.BufferedOutputStream(
             this.cx.output_stream
         );
-        this.serializer_buffer.set_close_base_stream(false);
-        this.serializer = new Serializer(id, this.serializer_buffer);
+        serializer_buffer.set_close_base_stream(false);
+        this.serializer = new Serializer(id, serializer_buffer);
 
         // Not buffering the Deserializer because it uses a
         // DataInputStream, which is already buffered
@@ -352,13 +351,6 @@ public class Geary.Imap.ClientConnection : BaseObject, Logging.Source {
             this.serializer = null;
         }
 
-        if (this.serializer_buffer != null) {
-            yield this.serializer_buffer.close_async(
-                GLib.Priority.DEFAULT, cancellable
-            );
-            this.serializer_buffer = null;
-        }
-
         var deserializer = this.deserializer;
         if (deserializer != null) {
             deserializer.bytes_received.disconnect(on_bytes_received);


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