Properly behave if we manage to connect in the second attempt.
authorSenko Rasic <senko.rasic@collabora.co.uk>
Wed, 06 Feb 2008 00:12:51 +0100
changeset 330 f606ce2a849e
parent 329 27b7a4649b6e
child 331 884c0d7edefc
Properly behave if we manage to connect in the second attempt.
loudmouth/lm-socket.c
--- a/loudmouth/lm-socket.c	Tue Feb 05 23:57:32 2008 +0100
+++ b/loudmouth/lm-socket.c	Wed Feb 06 00:12:51 2008 +0100
@@ -485,10 +485,12 @@
 			g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET,
 			       "Connection failed.\n");
 
-			_lm_socket_failed_with_error (connect_data, err);
-
-			socket->watch_connect = NULL;
-			return FALSE;
+			/* error condition, but might be possible to recover
+			 * from it (by connecting to the next host) */
+			if (!_lm_socket_failed_with_error (connect_data, err)) {
+				socket->watch_connect = NULL;
+				return FALSE;
+			}
 		}
 	}