changeset 24404:f18f37a62971

merge of '54ee2acb5f6ef92c29503315eb7c24bae221cd7b' and '6f0bf9d5a17857431bb0efc78f6d591e25772ddd'
author Mark Doliner <mark@kingant.net>
date Thu, 13 Nov 2008 09:00:45 +0000
parents 9e0458c98b4c (current diff) 89cb1c13036e (diff)
children 965699159512 e71c1fad229f 2f01775c81d5 7183d12b96ed d855ff9cf839 365b90fa23cf
files
diffstat 4 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slp.c	Thu Nov 13 08:39:44 2008 +0000
+++ b/libpurple/protocols/msn/slp.c	Thu Nov 13 09:00:45 2008 +0000
@@ -97,7 +97,7 @@
 			content);
 
 	g_free(content);
-	msn_slplink_unleash(slpcall->slplink);
+	msn_slplink_send_queued_slpmsgs(slpcall->slplink);
 }
 
 void
@@ -126,7 +126,7 @@
 						content);
 
 			g_free(content);
-			msn_slplink_unleash(slpcall->slplink);
+			msn_slplink_send_queued_slpmsgs(slpcall->slplink);
 
 			msn_slpcall_destroy(slpcall);
 		}
--- a/libpurple/protocols/msn/slpcall.c	Thu Nov 13 08:39:44 2008 +0000
+++ b/libpurple/protocols/msn/slpcall.c	Thu Nov 13 09:00:45 2008 +0000
@@ -191,7 +191,7 @@
 	g_return_if_fail(slpcall->slplink != NULL);
 
 	send_bye(slpcall, "application/x-msnmsgr-sessionclosebody");
-	msn_slplink_unleash(slpcall->slplink);
+	msn_slplink_send_queued_slpmsgs(slpcall->slplink);
 	msn_slpcall_destroy(slpcall);
 }
 
--- a/libpurple/protocols/msn/slplink.c	Thu Nov 13 08:39:44 2008 +0000
+++ b/libpurple/protocols/msn/slplink.c	Thu Nov 13 09:00:45 2008 +0000
@@ -343,7 +343,7 @@
 	slpmsg->msgs = g_list_remove(slpmsg->msgs, msg);
 }
 
-void
+static void
 msn_slplink_release_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg)
 {
 	MsnMessage *msg;
@@ -400,7 +400,7 @@
 {
 	slpmsg->id = slplink->slp_seq_id++;
 
-	g_queue_push_head(slplink->slp_msg_queue, slpmsg);
+	g_queue_push_tail(slplink->slp_msg_queue, slpmsg);
 }
 
 void
@@ -412,13 +412,12 @@
 }
 
 void
-msn_slplink_unleash(MsnSlpLink *slplink)
+msn_slplink_send_queued_slpmsgs(MsnSlpLink *slplink)
 {
 	MsnSlpMessage *slpmsg;
 
-	/* Send the queued msgs in the order they came. */
-
-	while ((slpmsg = g_queue_pop_tail(slplink->slp_msg_queue)) != NULL)
+	/* Send the queued msgs in the order they were created */
+	while ((slpmsg = g_queue_pop_head(slplink->slp_msg_queue)) != NULL)
 	{
 		msn_slplink_release_slpmsg(slplink, slpmsg);
 	}
@@ -635,7 +634,7 @@
 			/* Release all the messages and send the ACK */
 
 			msn_slplink_send_ack(slplink, msg);
-			msn_slplink_unleash(slplink);
+			msn_slplink_send_queued_slpmsgs(slplink);
 		}
 
 		msn_slpmsg_destroy(slpmsg);
--- a/libpurple/protocols/msn/slplink.h	Thu Nov 13 08:39:44 2008 +0000
+++ b/libpurple/protocols/msn/slplink.h	Thu Nov 13 09:00:45 2008 +0000
@@ -77,12 +77,10 @@
 MsnSlpCall *msn_slplink_find_slp_call(MsnSlpLink *slplink,
 									  const char *id);
 MsnSlpCall *msn_slplink_find_slp_call_with_session_id(MsnSlpLink *slplink, long id);
-void msn_slplink_release_slpmsg(MsnSlpLink *slplink,
-								MsnSlpMessage *slpmsg);
 void msn_slplink_queue_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg);
 void msn_slplink_send_slpmsg(MsnSlpLink *slplink,
 							 MsnSlpMessage *slpmsg);
-void msn_slplink_unleash(MsnSlpLink *slplink);
+void msn_slplink_send_queued_slpmsgs(MsnSlpLink *slplink);
 void msn_slplink_process_msg(MsnSlpLink *slplink, MsnMessage *msg);
 void msn_slplink_request_ft(MsnSlpLink *slplink, PurpleXfer *xfer);