changeset 8243:217643616a74

[gaim-migrate @ 8966] a yahoo patch from Daniel (datallah) Atallah that i wish we didn't need, and another: "When the auto-reconnect plugin is unloaded, it doesn't unregister the "signed-off" account event listener, causing it to continue to try to reconnect you even if it isn't loaded. This unregisters the listener when the plugin is unloaded and also prevents any pending reconnect events from being attempted when the timeout fires." committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Thu, 12 Feb 2004 19:17:54 +0000
parents 1c06cadec61a
children 5e7ffea3f76a
files plugins/autorecon.c src/protocols/yahoo/yahoo.c
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/autorecon.c	Thu Feb 12 19:13:55 2004 +0000
+++ b/plugins/autorecon.c	Thu Feb 12 19:17:54 2004 +0000
@@ -18,6 +18,8 @@
 static GHashTable *hash = NULL;
 
 static gboolean do_signon(gpointer data) {
+	g_return_val_if_fail(hash != NULL, FALSE);
+       	
 	GaimAccount *account = data;
 	GaimAutoRecon *info;
 
@@ -85,6 +87,9 @@
 static gboolean
 plugin_unload(GaimPlugin *plugin)
 {
+	gaim_signal_disconnect(gaim_connections_get_handle(), "signed-off",
+			plugin, GAIM_CALLBACK(reconnect));
+	
 	g_hash_table_destroy(hash);
 	hash = NULL;
 
--- a/src/protocols/yahoo/yahoo.c	Thu Feb 12 19:13:55 2004 +0000
+++ b/src/protocols/yahoo/yahoo.c	Thu Feb 12 19:17:54 2004 +0000
@@ -1917,7 +1917,7 @@
 	GaimConnection *gc = data;
 	GaimAccount *account = gaim_connection_get_account(gc);
 	struct yahoo_data *yd = gc->proto_data;
-	char buf[1024], *i = buf;
+	char buf[2048], *i = buf;
 	int len;
 	GString *s;
 
@@ -1933,7 +1933,7 @@
 
 	while ((i = strstr(i, "Set-Cookie: "))) {
 		i += strlen("Set-Cookie: ");
-		for (;*i != ';'; i++)
+		for (;*i != ';' && *i != '\0'; i++)
 			g_string_append_c(s, *i);
 
 		g_string_append(s, "; ");