changeset 30059:a6642358155b

We can't both remove a timeout and return FALSE in its callback.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 08 May 2010 00:08:01 +0000
parents 0b22c840f4f4
children 3f6daa187665
files libpurple/protocols/msn/directconn.c
diffstat 1 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/directconn.c	Fri May 07 20:04:42 2010 +0000
+++ b/libpurple/protocols/msn/directconn.c	Sat May 08 00:08:01 2010 +0000
@@ -825,10 +825,7 @@
 
 	g_return_val_if_fail(dc != NULL, FALSE);
 
-	if (dc->connect_timeout_handle != 0) {
-		purple_timeout_remove(dc->connect_timeout_handle);
-		dc->connect_timeout_handle = 0;
-	}
+	dc->connect_timeout_handle = 0;
 
 	if (dc->connect_data != NULL) {
 		purple_proxy_connect_cancel(dc->connect_data);
@@ -859,14 +856,15 @@
 
 	} else {
 		/*
-		 * Both internal and external connection attempts are failed.
+		 * Both internal and external connection attempts failed.
 		 * Fall back to p2p transfer.
 		 */
-		MsnSlpCall	*slpcall = dc->slpcall;
+		MsnSlpCall *slpcall = dc->slpcall;
 
 		msn_dc_destroy(dc);
-		/* Start p2p file transfer */
-		msn_slpcall_session_init(slpcall);
+		/* Start p2p file transfer, if possible */
+		if (slpcall)
+			msn_slpcall_session_init(slpcall);
 	}
 
 	return FALSE;