[geary] Fix an assertion when closing TLS connections. Bug 765287.



commit aa21e09f4a149eca7eed5c886ac71731e1bd1046
Author: Michael James Gratton <mike vee net>
Date:   Wed Apr 20 15:22:43 2016 +1000

    Fix an assertion when closing TLS connections. Bug 765287.
    
    Geary.Imap.ClientConnection::disconnect_async is causing its TLS
    connection to be disposed of, before closing the instance's
    Serialiser. When the Serialiser is closed and displosed of, the
    underlying stream attempts a flush, but since s connection has already
    been displosed of, triggers an assertion failure instead.
    
    * src/engine/imap/transport/imap-client-connection.vala
      (::disconnect_async): Ensure the serialiser is closed and disposed of
      before closing the TLS connection.

 .../imap/transport/imap-client-connection.vala     |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/engine/imap/transport/imap-client-connection.vala 
b/src/engine/imap/transport/imap-client-connection.vala
index b89d4f4..43cafa7 100644
--- a/src/engine/imap/transport/imap-client-connection.vala
+++ b/src/engine/imap/transport/imap-client-connection.vala
@@ -405,8 +405,7 @@ public class Geary.Imap.ClientConnection : BaseObject {
         // To guard against reentrancy
         SocketConnection close_cx = cx;
         cx = null;
-        ios = null;
-        
+
         // unschedule before yielding to stop the Deserializer
         unschedule_flush_timeout();
         
@@ -421,12 +420,15 @@ public class Geary.Imap.ClientConnection : BaseObject {
         Error? close_err = null;
         try {
             debug("[%s] Disconnecting...", to_string());
+            yield ios.close_async(Priority.DEFAULT, cancellable);
             yield close_cx.close_async(Priority.DEFAULT, cancellable);
             debug("[%s] Disconnected", to_string());
         } catch (Error err) {
             debug("[%s] Error disconnecting: %s", to_string(), err.message);
             close_err = err;
         } finally {
+            ios = null;
+
             fsm.issue(Event.DISCONNECTED);
             
             if (close_err != null)


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