pidgin: 5bfb0ca7: If there's stuff stuck in the DC queue, ...

qulogic at pidgin.im qulogic at pidgin.im
Fri May 21 18:03:21 EDT 2010


-----------------------------------------------------------------
Revision: 5bfb0ca73bb205b34170e5e0c07c35f5e8598734
Ancestor: 0064098d5f2b1cf6e031193f37ab107e30af1044
Author: qulogic at pidgin.im
Date: 2010-05-20T09:06:47
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5bfb0ca73bb205b34170e5e0c07c35f5e8598734

Modified files:
        libpurple/protocols/msn/directconn.c

ChangeLog: 

If there's stuff stuck in the DC queue, then try to send it over the SB if
we're dropping back to it.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/directconn.c	22c344c7e1663a75674f1c5331ccbd480a8ca347
+++ libpurple/protocols/msn/directconn.c	39973eb77ccdf164e69d05ced18da7022f8db575
@@ -318,6 +318,7 @@ msn_dc_fallback_to_p2p(MsnDirectConn *dc
 {
 	MsnSlpLink *slplink;
 	MsnSlpCall *slpcall;
+	GQueue *queue = NULL;
 
 	purple_debug_info("msn", "msn_dc_try_fallback_to_p2p %p\n", dc);
 
@@ -325,11 +326,24 @@ msn_dc_fallback_to_p2p(MsnDirectConn *dc
 
 	slpcall = dc->slpcall;
 	slplink = msn_slplink_ref(dc->slplink);
+	if (slpcall && !g_queue_is_empty(dc->out_queue)) {
+		queue = dc->out_queue;
+		dc->out_queue = NULL;
+	}
 
 	msn_dc_destroy(dc);
 
-	if (slpcall)
+	if (slpcall) {
 		msn_slpcall_session_init(slpcall);
+		if (queue) {
+			while (!g_queue_is_empty(queue)) {
+				MsnDirectConnPacket *p = g_queue_pop_head(queue);
+				msn_slplink_send_msg(slplink, p->msg);
+				msn_dc_destroy_packet(p);
+			}
+			g_queue_free(queue);
+		}
+	}
 	msn_slplink_unref(slplink);
 }
 


More information about the Commits mailing list