From 6e2ccb01526aa6f608e4f9f1109eadd3f48c6269 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sun, 26 Aug 2012 22:03:44 +0300 Subject: [PATCH] telepathy: connection shutdown crash fix We don't have a valid backend connection yet, so we must return FALSE when sipe_backend_connection_is_valid() is called. --- src/telepathy/telepathy-connection.c | 12 ++++++++++++ src/telepathy/telepathy-stubs.c | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/telepathy/telepathy-connection.c b/src/telepathy/telepathy-connection.c index 129f3a8e..671e486d 100644 --- a/src/telepathy/telepathy-connection.c +++ b/src/telepathy/telepathy-connection.c @@ -47,6 +47,7 @@ typedef struct _SipeConnection { gchar *server; gchar *port; guint transport; + gboolean is_valid; } SipeConnection; /* @@ -228,6 +229,9 @@ TpBaseConnection *sipe_telepathy_connection_new(TpBaseProtocol *protocol, SIPE_CORE_FLAG_UNSET(SSO); /* @TODO: add parameters for these */ + /* no connection yet */ + conn->is_valid = FALSE; + /* server name */ if (server && strlen(server)) conn->server = g_strdup(server); @@ -262,6 +266,14 @@ TpBaseConnection *sipe_telepathy_connection_new(TpBaseProtocol *protocol, /* + * Backend adaptor functions + */ +gboolean sipe_backend_connection_is_valid(struct sipe_core_public *sipe_public) { + SipeConnection *conn = (SipeConnection *) sipe_public->backend_private; + return(conn->is_valid); +} + +/* Local Variables: mode: c c-file-style: "bsd" diff --git a/src/telepathy/telepathy-stubs.c b/src/telepathy/telepathy-stubs.c index 07f4cf5e..ed208c96 100644 --- a/src/telepathy/telepathy-stubs.c +++ b/src/telepathy/telepathy-stubs.c @@ -172,7 +172,6 @@ void sipe_backend_connection_error(SIPE_UNUSED_PARAMETER struct sipe_core_public SIPE_UNUSED_PARAMETER sipe_connection_error error, SIPE_UNUSED_PARAMETER const gchar *msg) {} gboolean sipe_backend_connection_is_disconnecting(SIPE_UNUSED_PARAMETER struct sipe_core_public *sipe_public) { return(FALSE); } -gboolean sipe_backend_connection_is_valid(SIPE_UNUSED_PARAMETER SIPE_UNUSED_PARAMETER struct sipe_core_public *sipe_public) { return(TRUE); } /** FILE TRANSFER ************************************************************/ -- 2.11.4.GIT