diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2012-10-30 16:30:10 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2012-10-30 16:30:10 +0000 |
commit | 339c7273dcb604a639ea2b54461b24bd4f252dd6 (patch) | |
tree | 42235f762b78762aa10741f760a429f7a0529f00 /src/idle-server-connection.h | |
parent | 67b18831e0ea40dd3f4438426cfb0f703a3fc971 (diff) | |
download | telepathy-idle-339c7273dcb604a639ea2b54461b24bd4f252dd6.tar.gz |
Fix _force_disconnect to actually forcibly disconnect.
Previously, if the network connection had gone away _force_disconnect()
would not actually make the connection die any faster, because
g_io_stream_close_async() waits for a reply by default.
But by pulling the same trick with a cancelled cancellable as is used
for ping timeouts, we can fix this.
I tested this by:
* Connecting to a server (with keepalive-interval=0 to ensure that
doesn't interfere).
* Pulling out my network cable (breaking the connection) but leaving my
wireless connection up.
* calling Disconnect() on the connection.
Before, the connection would never finish disconnecting; after, the
_force_disconnect() timeout actually does something useful and the
connection dies properly.
Diffstat (limited to 'src/idle-server-connection.h')
-rw-r--r-- | src/idle-server-connection.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/idle-server-connection.h b/src/idle-server-connection.h index 207fedc..8ce36ca 100644 --- a/src/idle-server-connection.h +++ b/src/idle-server-connection.h @@ -73,6 +73,7 @@ void idle_server_connection_connect_async(IdleServerConnection *conn, GCancellab gboolean idle_server_connection_connect_finish(IdleServerConnection *conn, GAsyncResult *result, GError **error); void idle_server_connection_disconnect_async(IdleServerConnection *conn, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); void idle_server_connection_disconnect_full_async(IdleServerConnection *conn, guint reason, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +void idle_server_connection_force_disconnect(IdleServerConnection *conn); gboolean idle_server_connection_disconnect_finish(IdleServerConnection *conn, GAsyncResult *result, GError **error); void idle_server_connection_send_async(IdleServerConnection *conn, const gchar *cmd, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean idle_server_connection_send_finish(IdleServerConnection *conn, GAsyncResult *result, GError **error); |