[Telepathy-commits] [telepathy-gabble/master] socks5_error: always fire the connection-error signal if the state was not connected

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Tue Mar 17 09:43:06 PDT 2009


---
 src/bytestream-socks5.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/bytestream-socks5.c b/src/bytestream-socks5.c
index c7a5277..ecfb1bd 100644
--- a/src/bytestream-socks5.c
+++ b/src/bytestream-socks5.c
@@ -615,8 +615,6 @@ socks5_error (GabbleBytestreamSocks5 *self)
 
       DEBUG ("no more streamhosts to try");
 
-      g_signal_emit_by_name (self, "connection-error");
-
       g_assert (priv->msg_for_acknowledge_connection != NULL);
       _gabble_connection_send_iq_error (priv->conn,
           priv->msg_for_acknowledge_connection, XMPP_ERROR_ITEM_NOT_FOUND,
@@ -626,6 +624,12 @@ socks5_error (GabbleBytestreamSocks5 *self)
       priv->msg_for_acknowledge_connection = NULL;
     }
 
+  if (previous_state != SOCKS5_STATE_CONNECTED &&
+      previous_state != SOCKS5_STATE_ERROR)
+    {
+      g_signal_emit_by_name (self, "connection-error");
+    }
+
   DEBUG ("error, closing the connection\n");
 
   gabble_bytestream_socks5_close (GABBLE_BYTESTREAM_IFACE (self), NULL);
-- 
1.5.6.5




More information about the telepathy-commits mailing list