2006-03-20 Mikael Hallendal <micke@imendio.com>
* loudmouth/lm-connection.c:
(connection_do_open): Fixed up some of the error codes replied.
(lm_connection_open_and_block):
- Set the error if connection fails.
- Fixes LM-15.
--- a/ChangeLog Mon Mar 20 14:19:13 2006 +0000
+++ b/ChangeLog Mon Mar 20 14:54:06 2006 +0000
@@ -1,3 +1,11 @@
+2006-03-20 Mikael Hallendal <micke@imendio.com>
+
+ * loudmouth/lm-connection.c:
+ (connection_do_open): Fixed up some of the error codes replied.
+ (lm_connection_open_and_block):
+ - Set the error if connection fails.
+ - Fixes LM-15.
+
2006-03-20 Mikael Hallendal <micke@imendio.com>
* Makefile.am:
--- a/loudmouth/lm-connection.c Mon Mar 20 14:19:13 2006 +0000
+++ b/loudmouth/lm-connection.c Mon Mar 20 14:54:06 2006 +0000
@@ -615,7 +615,7 @@
if (lm_connection_is_open (connection)) {
g_set_error (error,
LM_ERROR,
- LM_ERROR_CONNECTION_NOT_OPEN,
+ LM_ERROR_CONNECTION_OPEN,
"Connection is already open, call lm_connection_close() first");
return FALSE;
}
@@ -623,7 +623,7 @@
if (!connection->server) {
g_set_error (error,
LM_ERROR,
- LM_ERROR_CONNECTION_OPEN,
+ LM_ERROR_CONNECTION_FAILED,
"You need to set the server hostname in the call to lm_connection_new()");
return FALSE;
}
@@ -655,7 +655,7 @@
if (getaddrinfo (proxy_server, NULL, &req, &ans) != 0) {
g_set_error (error,
LM_ERROR,
- LM_ERROR_CONNECTION_OPEN,
+ LM_ERROR_CONNECTION_FAILED,
"getaddrinfo() failed");
return FALSE;
}
@@ -668,7 +668,7 @@
NULL, &req, &ans) != 0) {
g_set_error (error,
LM_ERROR,
- LM_ERROR_CONNECTION_OPEN,
+ LM_ERROR_CONNECTION_FAILED,
"getaddrinfo() failed");
return FALSE;
}
@@ -1285,6 +1285,12 @@
return TRUE;
}
+ /* Need to set the error here: LM-15 */
+ g_set_error (error,
+ LM_ERROR,
+ LM_ERROR_CONNECTION_FAILED,
+ "Opening the connection failed");
+
return FALSE;
}