soc.2010.msn-tlc: 9fcc5797: Remove session_id from SlpMsg and use th...
masca at cpw.pidgin.im
masca at cpw.pidgin.im
Thu Jul 29 21:37:07 EDT 2010
----------------------------------------------------------------------
Revision: 9fcc579777f9e46b5cd8901b018d084ab158c931
Parent: c8d4b23360e24d2b31acc3c0e639e753ec858a41
Author: masca at cpw.pidgin.im
Date: 07/21/10 15:59:38
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/9fcc579777f9e46b5cd8901b018d084ab158c931
Changelog:
Remove session_id from SlpMsg and use the one from the header.
Changes against parent c8d4b23360e24d2b31acc3c0e639e753ec858a41
patched libpurple/protocols/msn/slpcall.c
patched libpurple/protocols/msn/slplink.c
patched libpurple/protocols/msn/slpmsg.c
patched libpurple/protocols/msn/slpmsg.h
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slpcall.c 3511348a10e4d69ef7f0e42ee6b1d7092a533a5d
+++ libpurple/protocols/msn/slpcall.c 7fc47487216663a4568d0b5422e339490ec8fb7b
@@ -1066,7 +1066,7 @@ msn_slp_process_msg(MsnSlpLink *slplink,
{
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 @@ msn_slp_process_msg(MsnSlpLink *slplink,
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)
{
============================================================
--- libpurple/protocols/msn/slplink.c ff5edcdf6c483de04e05bf48b18f3e2b65e99d1b
+++ libpurple/protocols/msn/slplink.c d3fd116bd2f3e23666e9018152a6cae1c6440e1c
@@ -354,17 +354,14 @@ msn_slplink_release_slpmsg(MsnSlpLink *s
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 @@ msn_slplink_message_find(MsnSlpLink *slp
{
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 @@ msn_slplink_process_msg(MsnSlpLink *slpl
{
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 ||
============================================================
--- libpurple/protocols/msn/slpmsg.c fde14bda67613c8c8589fb8691e071a353b8f922
+++ libpurple/protocols/msn/slpmsg.c 94b6f99e74593fd321aed9800ac84e711a1b3900
@@ -48,7 +48,7 @@ msn_slpmsg_new(MsnSlpLink *slplink)
else
slpmsg->slplink = NULL;
- slpmsg->header = NULL;
+ slpmsg->header = g_new0(MsnP2PHeader, 1);
slpmsg->footer = NULL;
return slpmsg;
@@ -242,7 +242,7 @@ MsnSlpMessage *msn_slpmsg_ack_new(MsnP2P
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 *msn_slpmsg_dataprep_new(M
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";
============================================================
--- libpurple/protocols/msn/slpmsg.h edb15cde6c3385fb0265c4b24d9d581616339e20
+++ libpurple/protocols/msn/slpmsg.h f8b11a300450cbaa1e93c91ef128bfff1e4eaea7
@@ -48,7 +48,6 @@ struct _MsnSlpMessage
MsnP2PHeader *header;
MsnP2PFooter *footer;
- long session_id;
long id;
long ack_id;
long ack_sub_id;
More information about the Commits
mailing list