[gtk-vnc] Don't close the socket before the coroutine shut down



commit 7e698972a967c53f61e1c0a599e639931b6bf658
Author: Guido Günther <agx sigxcpu org>
Date:   Fri Sep 17 18:18:35 2010 +0100

    Don't close the socket before the coroutine shut down
    
    The connection shutdown needs the socket intact:
    
    7  0xb6d38cdf in vnc_connection_tls_push (transport=0x8d84108, data=0x8df33c0, len=229) at vncconnection.c:942
    8  0xb6b30437 in ?? () from /usr/lib/libgnutls.so.26
    9  0xb6b2d12c in _gnutls_send_int () from /usr/lib/libgnutls.so.26
    10 0xb6b4d682 in gnutls_alert_send () from /usr/lib/libgnutls.so.26
    11 0xb6b2d662 in gnutls_bye () from /usr/lib/libgnutls.so.26
    12 0xb6d3a620 in vnc_connection_close (conn=0x8d84108) at vncconnection.c:4323
    
    so close the socket after the coroutine shutdown. Otherwise it fills the
    console with:
    
    (gvncviewer:11056): GLib-GIO-CRITICAL **: g_socket_send: assertion `G_IS_SOCKET (socket) && buffer != NULL' failed
    
    and gets stuck in an endless loop.

 src/vncconnection.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/vncconnection.c b/src/vncconnection.c
index 9ad472a..3727be7 100644
--- a/src/vncconnection.c
+++ b/src/vncconnection.c
@@ -4402,16 +4402,16 @@ void vnc_connection_shutdown(VncConnection *conn)
 		priv->open_id = 0;
 	}
 
+	priv->fd = -1;
+	priv->has_error = 1;
+	VNC_DEBUG("Waking up couroutine to shutdown gracefully");
+	g_io_wakeup(&priv->wait);
+
 	if (priv->sock) {
 		g_socket_close(priv->sock, NULL);
 		g_object_unref(priv->sock);
 		priv->sock = NULL;
 	}
-
-	priv->fd = -1;
-	priv->has_error = 1;
-	VNC_DEBUG("Waking up couroutine to shutdown gracefully");
-	g_io_wakeup(&priv->wait);
 }
 
 gboolean vnc_connection_is_open(VncConnection *conn)



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