changeset 28661:a143b7fcff4c

merge of '363fb1f7fa72426b9e239a320bd53c6bd59f57f9' and 'ff8f05c45f3ff64c9fa0b6cfeaa6c7e44983bf38'
author Paul Aurich <paul@darkrain42.org>
date Fri, 25 Sep 2009 03:41:49 +0000
parents 8aa24fd75490 (current diff) 578b4048a501 (diff)
children 4b3756ed1053 a07e46f20644
files
diffstat 7 files changed, 24 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Thu Sep 24 20:38:30 2009 +0000
+++ b/COPYRIGHT	Fri Sep 25 03:41:49 2009 +0000
@@ -275,6 +275,7 @@
 Lokheed
 Norberto Lopes
 Shlomi Loubaton
+Brian Lu
 Uli Luckas
 Matthew Luckie
 Marcus Lundblad
--- a/ChangeLog	Thu Sep 24 20:38:30 2009 +0000
+++ b/ChangeLog	Fri Sep 25 03:41:49 2009 +0000
@@ -3,10 +3,15 @@
 version 2.6.3 (??/??/20??):
 	XMPP:
 	* Fix a crash when attempting to validate an invalid JID.
+	* Resolve an issue when connecting to iChat Server when no resource
+	  is specified.
+	* Fix a crash when adding a buddy without an '@'.
 
 	General:
 	* New 'plugins' sub-command to 'debug' command (i.e. '/debug plugins')
 	  to announce the list of loaded plugins (in both Finch and Pidgin).
+	* Fix a crash when performing DNS queries on Unixes that use the
+	  blocking DNS lookups.  (Brian Lu)
 
 version 2.6.2 (09/05/2009):
 	libpurple:
--- a/libpurple/dnsquery.c	Thu Sep 24 20:38:30 2009 +0000
+++ b/libpurple/dnsquery.c	Fri Sep 25 03:41:49 2009 +0000
@@ -918,7 +918,6 @@
 	PurpleDnsQueryData *query_data;
 	struct sockaddr_in sin;
 	GSList *hosts = NULL;
-	char *hostname;
 
 	query_data = data;
 	query_data->timeout = 0;
@@ -931,6 +930,7 @@
 
 	if (!inet_aton(query_data->hostname, &sin.sin_addr)) {
 		struct hostent *hp;
+		gchar *hostname;
 #ifdef USE_IDN
 		if (!dns_str_is_ascii(query_data->hostname)) {
 			int ret = purple_network_convert_idn_to_ascii(query_data->hostname,
@@ -956,11 +956,11 @@
 		memset(&sin, 0, sizeof(struct sockaddr_in));
 		memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length);
 		sin.sin_family = hp->h_addrtype;
+		g_free(hostname);
 	} else
 		sin.sin_family = AF_INET;
 	sin.sin_port = htons(query_data->port);
 
-	g_free(hostname);
 	hosts = g_slist_append(hosts, GINT_TO_POINTER(sizeof(sin)));
 	hosts = g_slist_append(hosts, g_memdup(&sin, sizeof(sin)));
 
--- a/libpurple/protocols/jabber/auth.c	Thu Sep 24 20:38:30 2009 +0000
+++ b/libpurple/protocols/jabber/auth.c	Fri Sep 25 03:41:49 2009 +0000
@@ -692,7 +692,8 @@
 	JabberIq *iq;
 	xmlnode *query, *username;
 
-	/* We can end up here without encryption if the server doesn't support
+	/*
+	 * We can end up here without encryption if the server doesn't support
 	 * <stream:features/> and we're not using old-style SSL.  If the user
 	 * is requiring SSL/TLS, we need to enforce it.
 	 */
@@ -704,6 +705,16 @@
 		return;
 	}
 
+	/*
+	 * IQ Auth doesn't have support for resource binding, so we need to pick a
+	 * default resource so it will work properly.  jabberd14 throws an error and
+	 * iChat server just fails silently.
+	 */
+	if (!js->user->resource || *js->user->resource == '\0') {
+		g_free(js->user->resource);
+		js->user->resource = g_strdup("Home");
+	}
+
 #ifdef HAVE_CYRUS_SASL
 	/* If we have Cyrus SASL, then passwords will have been set
 	 * to OPTIONAL for this protocol. So, we need to do our own
--- a/libpurple/protocols/jabber/chat.c	Thu Sep 24 20:38:30 2009 +0000
+++ b/libpurple/protocols/jabber/chat.c	Fri Sep 25 03:41:49 2009 +0000
@@ -99,6 +99,9 @@
 {
 	JabberChat *chat = NULL;
 
+	g_return_val_if_fail(room != NULL, NULL);
+	g_return_val_if_fail(server != NULL, NULL);
+
 	if(NULL != js->chats)
 	{
 		char *room_jid = g_strdup_printf("%s@%s", room, server);
--- a/libpurple/protocols/jabber/jabber.c	Thu Sep 24 20:38:30 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Fri Sep 25 03:41:49 2009 +0000
@@ -1593,15 +1593,6 @@
 			if(js->protocol_version == JABBER_PROTO_0_9 && js->registration) {
 				jabber_register_start(js);
 			} else if(js->auth_type == JABBER_AUTH_IQ_AUTH) {
-				/* with dreamhost's xmpp server at least, you have to
-				   specify a resource or you will get a "406: Not
-				   Acceptable"
-				*/
-				if(!js->user->resource || *js->user->resource == '\0') {
-					g_free(js->user->resource);
-					js->user->resource = g_strdup("Home");
-				}
-
 				jabber_auth_start_old(js);
 			}
 			break;
--- a/libpurple/protocols/jabber/roster.c	Thu Sep 24 20:38:30 2009 +0000
+++ b/libpurple/protocols/jabber/roster.c	Fri Sep 25 03:41:49 2009 +0000
@@ -354,7 +354,7 @@
 	}
 
 	/* Adding a chat room or a chat buddy to the roster is *not* supported. */
-	if (jabber_chat_find(js, jid->node, jid->domain) != NULL) {
+	if (jid->node && jabber_chat_find(js, jid->node, jid->domain) != NULL) {
 		/*
 		 * This is the same thing Bonjour does. If it causes problems, move
 		 * it to an idle callback.