2003-11-11 Mikael Hallendal <micke@imendio.com>
authorhallski <hallski>
Tue, 11 Nov 2003 12:22:45 +0000
changeset 54 eee846c76348
parent 53 d9a0e2c2a9aa
child 55 849786a27b00
2003-11-11 Mikael Hallendal <micke@imendio.com> * Makefile.am: - Added README.WIN32 so it will be distributed next release. * loudmouth/lm-connection.c: (connection_do_close): Remove the incoming source. Reported and fix proposed by Christopher G. Abiad (lm_connection_authenticate_and_block): - Set error message on auth failed (should be more explicit). Fixes problem when you try to read the error message on fail.
ChangeLog
loudmouth/lm-connection.c
--- a/ChangeLog	Tue Nov 11 12:21:53 2003 +0000
+++ b/ChangeLog	Tue Nov 11 12:22:45 2003 +0000
@@ -1,3 +1,14 @@
+2003-11-11  Mikael Hallendal  <micke@imendio.com>
+
+	* Makefile.am: 
+	- Added README.WIN32 so it will be distributed next release.
+	* loudmouth/lm-connection.c:
+	(connection_do_close): Remove the incoming source. Reported and fix
+	  proposed by Christopher G. Abiad
+	(lm_connection_authenticate_and_block):
+	- Set error message on auth failed (should be more explicit). Fixes
+	  problem when you try to read the error message on fail.
+
 2003-11-11  Mikael Hallendal  <micke@imendio.com>
 
 	* Makefile.am: 
--- a/loudmouth/lm-connection.c	Tue Nov 11 12:21:53 2003 +0000
+++ b/loudmouth/lm-connection.c	Tue Nov 11 12:22:45 2003 +0000
@@ -402,7 +402,10 @@
 
 		g_io_channel_unref (connection->io_channel);
 		connection->io_channel = NULL;
-	} 
+	}
+
+	g_source_remove (g_source_get_id (connection->incoming_source));
+	g_source_unref (connection->incoming_source);
 
 	if (!connection->is_open) {
 		return;
@@ -484,7 +487,8 @@
 	}
 
 	buf[bytes_read] = '\0';
-	g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "\nRECV:\n");
+	g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "\nRECV [%d]:\n", 
+	       bytes_read);
 	g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, 
 	       "-----------------------------------\n");
 	g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "'%s'\n", buf);
@@ -1213,6 +1217,10 @@
 		return TRUE;
 		break;
 	case LM_MESSAGE_SUB_TYPE_ERROR:
+		g_set_error (error,
+			     LM_ERROR,
+			     LM_ERROR_AUTH_FAILED,
+			     "Authentication failed");
 		return FALSE;
 		break;
 	default: