Hi all,

Currently if you try to connect to a known host which is up, on a port
which is not in use, then it usually comes back pretty quickly saying
Connection refused (error 111).  If the host does not exist then the
Connection timed out (error 110) error is reported instead.  These
errors are probably the most common, however, the error never gets back
to the application using Loudmouth.

I have attached a patch which simply calls the open callback function
when the connection attempt fails.

-- 
Regards,
Martyn
? connect_fail_notify.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/loudmouth/ChangeLog,v
retrieving revision 1.92
diff -u -b -B -p -r1.92 ChangeLog
--- ChangeLog	19 Jan 2005 22:12:14 -0000	1.92
+++ ChangeLog	27 Jan 2005 12:21:28 -0000
@@ -1,3 +1,9 @@
+2005-01-27  Martyn Russell  <[email protected]>
+
+	* loudmouth/lm-connection.c (_lm_connection_failed_with_error): 
+	- Added fix to call the open callback when all connection attempts
+	fail to the destination server.
+
 2005-01-19  Mikael Hallendal  <[email protected]>
 
 	* loudmouth/lm-connection.c: (connection_in_event):
Index: loudmouth/lm-connection.c
===================================================================
RCS file: /cvs/gnome/loudmouth/loudmouth/lm-connection.c,v
retrieving revision 1.45
diff -u -b -B -p -r1.45 lm-connection.c
--- loudmouth/lm-connection.c	19 Jan 2005 22:12:15 -0000	1.45
+++ loudmouth/lm-connection.c	27 Jan 2005 12:21:28 -0000
@@ -395,6 +395,16 @@ _lm_connection_failed_with_error (LmConn
 	}
 	
 	if (connect_data->current_addr == NULL) {
+		LmConnection *connection;
+
+		connection = connect_data->connection;
+		if (connection->open_cb && connection->open_cb->func) {
+			LmCallback *cb = connection->open_cb;
+			
+			(* ((LmResultFunction) cb->func)) (connection, FALSE,
+							   cb->user_data);
+		}
+
 		freeaddrinfo (connect_data->resolved_addrs);
 		g_free (connect_data);
 	} else {

Reply via email to