soc.2008.yahoo: 27be5717: set yahoo_p2p_server_watcher, yahoo_p2p_...
sulabh at soc.pidgin.im
sulabh at soc.pidgin.im
Wed Nov 12 03:25:22 EST 2008
-----------------------------------------------------------------
Revision: 27be5717a9e511826529dca17c0ea1111ff0be5e
Ancestor: be30a51c44a9d818be6ea248d45bdd36e76fbae0
Author: sulabh at soc.pidgin.im
Date: 2008-11-12T08:19:56
Branch: im.pidgin.soc.2008.yahoo
URL: http://d.pidgin.im/viewmtn/revision/info/27be5717a9e511826529dca17c0ea1111ff0be5e
Modified files:
libpurple/protocols/yahoo/yahoo.c
ChangeLog:
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.
-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c c1e6381ac6a7b91de8d8bdd443a9fd5fee95d03a
+++ libpurple/protocols/yahoo/yahoo.c 031e425972a5e568022c33bf2f6cb976f534daf1
@@ -2613,8 +2613,10 @@ static gboolean yahoo_cancel_p2p_server_
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 @@ void yahoo_send_p2p_pkt(PurpleConnection
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 @@ static void yahoo_close(PurpleConnection
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);
More information about the Commits
mailing list