changeset 31293:6814678f3c63

Remove session_id from SlpMsg and use the one from the header.
author masca@cpw.pidgin.im
date Wed, 21 Jul 2010 19:59:38 +0000
parents 47b6eda87723
children 9f41998d4fcc
files libpurple/protocols/msn/slpcall.c libpurple/protocols/msn/slplink.c libpurple/protocols/msn/slpmsg.c libpurple/protocols/msn/slpmsg.h
diffstat 4 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slpcall.c	Mon Jul 19 21:11:32 2010 +0000
+++ b/libpurple/protocols/msn/slpcall.c	Wed Jul 21 19:59:38 2010 +0000
@@ -1066,7 +1066,7 @@
 	{
 		char *body_str;
 
-		if (slpmsg->session_id == 64)
+		if (slpmsg->header->session_id == 64)
 		{
 			/* This is for handwritten messages (Ink) */
 			GError *error = NULL;
@@ -1127,7 +1127,7 @@
 	         slpmsg->flags == (P2P_WML2009_COMP | P2P_MSN_OBJ_DATA) ||
 	         slpmsg->flags == P2P_FILE_DATA)
 	{
-		slpcall = msn_slplink_find_slp_call_with_session_id(slplink, slpmsg->session_id);
+		slpcall = msn_slplink_find_slp_call_with_session_id(slplink, slpmsg->header->session_id);
 
 		if (slpcall != NULL)
 		{
--- a/libpurple/protocols/msn/slplink.c	Mon Jul 19 21:11:32 2010 +0000
+++ b/libpurple/protocols/msn/slplink.c	Wed Jul 21 19:59:38 2010 +0000
@@ -354,17 +354,14 @@
 msn_slplink_release_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg)
 {
 	slpmsg = slpmsg;
-	slpmsg->header = g_new0(MsnP2PHeader, 1);
 	slpmsg->footer = g_new0(MsnP2PFooter, 1);
 
 	if (slpmsg->flags == P2P_NO_FLAG)
 	{
-		slpmsg->header->session_id = slpmsg->session_id;
 		slpmsg->header->ack_id = rand() % 0xFFFFFF00;
 	}
 	else if (slpmsg->flags == P2P_ACK)
 	{
-		slpmsg->header->session_id = slpmsg->session_id;
 		slpmsg->header->ack_id = slpmsg->ack_id;
 		slpmsg->header->ack_size = slpmsg->ack_size;
 		slpmsg->header->ack_sub_id = slpmsg->ack_sub_id;
@@ -455,7 +452,7 @@
 	{
 		MsnSlpMessage *slpmsg = e->data;
 
-		if ((slpmsg->session_id == session_id) && (slpmsg->id == id))
+		if ((slpmsg->header->session_id == session_id) && (slpmsg->id == id))
 			return slpmsg;
 	}
 
@@ -483,13 +480,13 @@
 	{
 		slpmsg = msn_slpmsg_new(slplink);
 		slpmsg->id = header->id;
-		slpmsg->session_id = header->session_id;
+		slpmsg->header->session_id = header->session_id;
 		slpmsg->size = header->total_size;
 		slpmsg->flags = header->flags;
 
-		if (slpmsg->session_id)
+		if (slpmsg->header->session_id)
 		{
-			slpmsg->slpcall = msn_slplink_find_slp_call_with_session_id(slplink, slpmsg->session_id);
+			slpmsg->slpcall = msn_slplink_find_slp_call_with_session_id(slplink, slpmsg->header->session_id);
 			if (slpmsg->slpcall != NULL)
 			{
 				if (slpmsg->flags == P2P_MSN_OBJ_DATA ||
--- a/libpurple/protocols/msn/slpmsg.c	Mon Jul 19 21:11:32 2010 +0000
+++ b/libpurple/protocols/msn/slpmsg.c	Wed Jul 21 19:59:38 2010 +0000
@@ -48,7 +48,7 @@
 	else
 		slpmsg->slplink = NULL;
 
-	slpmsg->header = NULL;
+	slpmsg->header = g_new0(MsnP2PHeader, 1);
 	slpmsg->footer = NULL;
 
 	return slpmsg;
@@ -242,7 +242,7 @@
 
 	slpmsg = msn_slpmsg_new(NULL);
 
-	slpmsg->session_id = header->session_id;
+	slpmsg->header->session_id = header->session_id;
 	slpmsg->size       = header->total_size;
 	slpmsg->flags      = P2P_ACK;
 	slpmsg->ack_id     = header->id;
@@ -272,8 +272,9 @@
 	MsnSlpMessage *slpmsg;
 
 	slpmsg = msn_slpmsg_new(NULL);
+
 	slpmsg->slpcall = slpcall;
-	slpmsg->session_id = slpcall->session_id;
+	slpmsg->header->session_id = slpcall->session_id;
 	msn_slpmsg_set_body(slpmsg, NULL, 4);
 	slpmsg->info = "SLP DATA PREP";
 
--- a/libpurple/protocols/msn/slpmsg.h	Mon Jul 19 21:11:32 2010 +0000
+++ b/libpurple/protocols/msn/slpmsg.h	Wed Jul 21 19:59:38 2010 +0000
@@ -48,7 +48,6 @@
 	MsnP2PHeader *header;
 	MsnP2PFooter *footer;
 
-	long session_id;
 	long id;
 	long ack_id;
 	long ack_sub_id;