# HG changeset patch # User Sulabh Mahajan # Date 1226477996 0 # Node ID 1317a9ae66e89ec4b432e2bd37f51c8cfcb64a9e # Parent bb5a6709d9b7a5b22a780ea64ea7bbe36e30d7b0 set yahoo_p2p_server_watcher, yahoo_p2p_server_timeout_handle to 0; check for nonnegative fd instead of nonzero; purple_timeout_remove yahoo_p2p_server_timeout_handle when disconnecting. diff -r bb5a6709d9b7 -r 1317a9ae66e8 libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Sun Sep 28 16:03:24 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Wed Nov 12 08:19:56 2008 +0000 @@ -2613,8 +2613,10 @@ purple_debug_warning("yahoo","yahoo p2p server timeout, peer failed to connect"); yahoo_p2p_disconnect_destroy_data(data); purple_input_remove(yd->yahoo_p2p_server_watcher); + yd->yahoo_p2p_server_watcher = 0; close(yd->yahoo_local_p2p_server_fd); yd->yahoo_local_p2p_server_fd = -1; + yd->yahoo_p2p_server_timeout_handle = 0; return FALSE; } @@ -2661,7 +2663,7 @@ account = purple_connection_get_account(gc); /* Do not send invitation if already listening for other connection */ - if(yd->yahoo_local_p2p_server_fd) + if(yd->yahoo_local_p2p_server_fd >= 0) return; /* One shouldn't try to connect to self */ @@ -3644,6 +3646,8 @@ yahoo_c_leave(gc, 1); /* 1 = YAHOO_CHAT_ID */ purple_timeout_remove(yd->yahoo_p2p_timer); + if(yd->yahoo_p2p_server_timeout_handle != 0) + purple_timeout_remove(yd->yahoo_p2p_server_timeout_handle); /* close p2p server if it is waiting for a peer to connect */ purple_input_remove(yd->yahoo_p2p_server_watcher);