changeset 15789:d94d3d0f1149

merge of '1e5814c18dbd7349240ceeec8f3d25583e42a7bd' and '8fd51b26e00adf83c2b8a53c556b308efa1c6c51'
author Evan Schoenberg <evan.s@dreskin.net>
date Tue, 13 Mar 2007 10:28:03 +0000
parents b25acae693cd (diff) 8cf610a18481 (current diff)
children 465a58f2c711
files
diffstat 7 files changed, 38 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/connection.c	Mon Mar 12 23:00:01 2007 +0000
+++ b/libpurple/connection.c	Tue Mar 13 10:28:03 2007 +0000
@@ -434,7 +434,11 @@
 	GaimConnectionUiOps *ops;
 
 	g_return_if_fail(gc   != NULL);
-	g_return_if_fail(text != NULL);
+
+	if (text != NULL) {
+		g_critical("gaim_connection_error: check `text != NULL' failed");
+		text = _("Unknown error");
+	}
 
 	/* If we've already got one error, we don't need any more */
 	if (gc->disconnect_timeout)
--- a/libpurple/plugins/ssl/ssl-gnutls.c	Mon Mar 12 23:00:01 2007 +0000
+++ b/libpurple/plugins/ssl/ssl-gnutls.c	Tue Mar 13 10:28:03 2007 +0000
@@ -83,7 +83,8 @@
 	gnutls_data->handshake_handler = 0;
 
 	if(ret != 0) {
-		gaim_debug_error("gnutls", "Handshake failed. Error %d\n", ret);
+		gaim_debug_error("gnutls", "Handshake failed. Error %s\n",
+			gnutls_strerror(ret));
 
 		if(gsc->error_cb != NULL)
 			gsc->error_cb(gsc, GAIM_SSL_HANDSHAKE_FAILED,
@@ -156,8 +157,16 @@
 		s = -1;
 		errno = EAGAIN;
 	} else if(s < 0) {
-		gaim_debug_error("gnutls", "receive failed: %d\n", s);
-		s = 0;
+		gaim_debug_error("gnutls", "receive failed: %s\n",
+				gnutls_strerror(s));
+		s = -1;
+		/*
+		 * TODO: Set errno to something more appropriate.  Or even
+		 *       better: allow ssl plugins to keep track of their
+		 *       own error message, then add a new ssl_ops function
+		 *       that returns the error message.
+		 */
+		errno = EIO;
 	}
 
 	return s;
@@ -177,8 +186,16 @@
 		s = -1;
 		errno = EAGAIN;
 	} else if(s < 0) {
-		gaim_debug_error("gnutls", "send failed: %d\n", s);
-		s = 0;
+		gaim_debug_error("gnutls", "send failed: %s\n",
+				gnutls_strerror(s));
+		s = -1;
+		/*
+		 * TODO: Set errno to something more appropriate.  Or even
+		 *       better: allow ssl plugins to keep track of their
+		 *       own error message, then add a new ssl_ops function
+		 *       that returns the error message.
+		 */
+		errno = EIO;
 	}
 
 	return s;
--- a/libpurple/protocols/jabber/roster.c	Mon Mar 12 23:00:01 2007 +0000
+++ b/libpurple/protocols/jabber/roster.c	Tue Mar 13 10:28:03 2007 +0000
@@ -380,7 +380,7 @@
 	GSList *groups = NULL;
 
 	buddies = g_slist_remove(buddies, buddy);
-	if(g_slist_length(buddies)) {
+	if(buddies != NULL) {
 		GaimBuddy *tmpbuddy;
 		GaimGroup *tmpgroup;
 
--- a/libpurple/protocols/jabber/si.c	Mon Mar 12 23:00:01 2007 +0000
+++ b/libpurple/protocols/jabber/si.c	Tue Mar 13 10:28:03 2007 +0000
@@ -783,7 +783,7 @@
 			return;
 
 		/* XXX: for now, send to the first resource available */
-		if(g_list_length(jb->resources) >= 1) {
+		if(jb->resources != NULL) {
 			char **who_v = g_strsplit(xfer->who, "/", 2);
 			char *who;
 
--- a/libpurple/protocols/novell/nmuser.c	Mon Mar 12 23:00:01 2007 +0000
+++ b/libpurple/protocols/novell/nmuser.c	Tue Mar 13 10:28:03 2007 +0000
@@ -1534,13 +1534,12 @@
 		}
 
 		/* Time to callback? */
-		if (g_slist_length(list) == 0) {
+		if (list == NULL) {
 			nm_response_cb cb = nm_request_get_callback(request);
 
 			if (cb) {
 				cb(user, 0, conference, conference);
 			}
-			g_slist_free(list);
 			nm_release_request(request);
 		}
 	}
--- a/pidgin/gtkimhtmltoolbar.c	Mon Mar 12 23:00:01 2007 +0000
+++ b/pidgin/gtkimhtmltoolbar.c	Tue Mar 13 10:28:03 2007 +0000
@@ -672,7 +672,7 @@
 	gtk_window_set_role(GTK_WINDOW(dialog), "smiley_dialog");
 	gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
 
-	if (g_slist_length(unique_smileys)) {
+	if (unique_smileys != NULL) {
 		struct smiley_button_list *ls, *it, *it_tmp;
 		GtkWidget *line;
 		int line_width = 0;
--- a/pidgin/plugins/musicmessaging/musicmessaging.c	Mon Mar 12 23:00:01 2007 +0000
+++ b/pidgin/plugins/musicmessaging/musicmessaging.c	Tue Mar 13 10:28:03 2007 +0000
@@ -235,16 +235,19 @@
 static int
 mmconv_from_conv_loc(GaimConversation *conv)
 {
+	GList *l;
 	MMConversation *mmconv_current = NULL;
 	guint i;
 	
-	for (i = 0; i < g_list_length(conversations); i++)
+	i = 0;
+	for (l = conversations; l != NULL; l = l->next)
 	{
-		mmconv_current = (MMConversation *)g_list_nth_data(conversations, i);
+		mmconv_current = l->data;
 		if (conv == mmconv_current->conv)
 		{
 			return i;
 		}
+		i++;
 	}
 	return -1;
 }
@@ -295,9 +298,9 @@
 plugin_unload(GaimPlugin *plugin) {
 	MMConversation *mmconv = NULL;
 	
-	while (g_list_length(conversations) > 0)
+	while (conversations != NULL)
 	{
-		mmconv = g_list_first(conversations)->data;
+		mmconv = conversations->data;
 		conv_destroyed(mmconv->conv);
 	}
 	return TRUE;