soc.2010.msn-tlc: 770fd6a2: Drop slp header and footer from MsnMessa...
masca at cpw.pidgin.im
masca at cpw.pidgin.im
Tue Jun 8 18:25:42 EDT 2010
-----------------------------------------------------------------
Revision: 770fd6a263447036b891bcab480f640894b26298
Ancestor: dfe571b8a1cbc768ce058e22ca86265cee393189
Author: masca at cpw.pidgin.im
Date: 2010-06-08T21:26:39
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/770fd6a263447036b891bcab480f640894b26298
Modified files:
libpurple/protocols/msn/directconn.c
libpurple/protocols/msn/msg.h libpurple/protocols/msn/slp.c
libpurple/protocols/msn/slplink.c
libpurple/protocols/msn/slpmsg.c
ChangeLog:
Drop slp header and footer from MsnMessage in favor of MsnSlpMessage->header and footer.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/directconn.c c195d08efa377e920a3c37095bd528ef14be782d
+++ libpurple/protocols/msn/directconn.c 2ba2caccaa232c569aee2a7a80c6010821004953
@@ -548,7 +548,7 @@ msn_dc_enqueue_msg(MsnDirectConn *dc, Ms
length = msg->body_len + P2P_PACKET_HEADER_SIZE;
p = msn_dc_new_packet(length);
- memcpy(p->data, &msg->msnslp_header, P2P_PACKET_HEADER_SIZE);
+ memcpy(p->data, msg->slpmsg->header, P2P_PACKET_HEADER_SIZE);
memcpy(p->data + P2P_PACKET_HEADER_SIZE, msg->body, msg->body_len);
p->sent_cb = msn_dc_send_packet_cb;
============================================================
--- libpurple/protocols/msn/msg.h e5c664027c0f16e394bc4e571746cd8df3cbc9f9
+++ libpurple/protocols/msn/msg.h 7c034264171cab1d93018fb274b9ab6ba9758a20
@@ -58,7 +58,7 @@ typedef enum
#include "session.h"
#include "transaction.h"
#include "user.h"
-#include "p2p.h"
+#include "slpmsg.h"
typedef void (*MsnMsgCb)(MsnMessage *, void *data);
@@ -78,6 +78,7 @@ struct _MsnMessage
MsnMsgType type;
gboolean msnslp_message;
+ MsnSlpMessage *slpmsg;
char *remote_user;
char flag;
@@ -89,9 +90,6 @@ struct _MsnMessage
guint total_chunks; /**< How many chunks in this multi-part message */
guint received_chunks; /**< How many chunks we've received so far */
- MsnP2PHeader msnslp_header;
- MsnP2PFooter msnslp_footer;
-
GHashTable *header_table;
GList *header_list;
============================================================
--- libpurple/protocols/msn/slp.c c688532169a5513bf3d4ae4c704ca4e772fe73c9
+++ libpurple/protocols/msn/slp.c f88c999f8ae623e7ecb6fb87d4e1be9d8908ea1f
@@ -1112,7 +1112,7 @@ msn_p2p_msg(MsnCmdProc *cmdproc, MsnMess
data = msn_message_get_bin_data(msg, &len);
- msn_slplink_process_msg(slplink, &msg->msnslp_header, data, len);
+ msn_slplink_process_msg(slplink, msg->slpmsg->header, data, len);
}
static void
============================================================
--- libpurple/protocols/msn/slplink.c 2ba74b8cc41197be7a95b3579367fa01a2aea837
+++ libpurple/protocols/msn/slplink.c b0caf7d5dca0655ea59d394ca4beeb722ff093e6
@@ -319,8 +319,8 @@ msn_slplink_send_msgpart(MsnSlpLink *slp
msn_message_set_bin_data(msg, slpmsg->buffer + slpmsg->offset, len);
}
- msg->msnslp_header.offset = slpmsg->offset;
- msg->msnslp_header.length = len;
+ slpmsg->header->offset = slpmsg->offset;
+ slpmsg->header->length = len;
}
if (purple_debug_is_verbose())
@@ -362,7 +362,7 @@ msg_ack(MsnMessage *msg, void *data)
real_size = (slpmsg->flags == P2P_ACK) ? 0 : slpmsg->size;
- slpmsg->offset += msg->msnslp_header.length;
+ slpmsg->offset += msg->slpmsg->header->length;
slpmsg->msgs = g_list_remove(slpmsg->msgs, msg);
@@ -418,17 +418,21 @@ msn_slplink_release_slpmsg(MsnSlpLink *s
slpmsg->msg = msg = msn_message_new_msnslp();
+ msg->slpmsg = slpmsg;
+ msg->slpmsg->header = g_new0(MsnP2PHeader, 1);
+ msg->slpmsg->footer = g_new0(MsnP2PFooter, 1);
+
if (slpmsg->flags == P2P_NO_FLAG)
{
- msg->msnslp_header.session_id = slpmsg->session_id;
- msg->msnslp_header.ack_id = rand() % 0xFFFFFF00;
+ msg->slpmsg->header->session_id = slpmsg->session_id;
+ msg->slpmsg->header->ack_id = rand() % 0xFFFFFF00;
}
else if (slpmsg->flags == P2P_ACK)
{
- msg->msnslp_header.session_id = slpmsg->session_id;
- msg->msnslp_header.ack_id = slpmsg->ack_id;
- msg->msnslp_header.ack_size = slpmsg->ack_size;
- msg->msnslp_header.ack_sub_id = slpmsg->ack_sub_id;
+ msg->slpmsg->header->session_id = slpmsg->session_id;
+ msg->slpmsg->header->ack_id = slpmsg->ack_id;
+ msg->slpmsg->header->ack_size = slpmsg->ack_size;
+ msg->slpmsg->header->ack_sub_id = slpmsg->ack_sub_id;
}
else if (slpmsg->flags == P2P_MSN_OBJ_DATA ||
slpmsg->flags == (P2P_WML2009_COMP | P2P_MSN_OBJ_DATA) ||
@@ -438,21 +442,21 @@ msn_slplink_release_slpmsg(MsnSlpLink *s
slpcall = slpmsg->slpcall;
g_return_if_fail(slpcall != NULL);
- msg->msnslp_header.session_id = slpcall->session_id;
- msg->msnslp_footer.value = slpcall->app_id;
- msg->msnslp_header.ack_id = rand() % 0xFFFFFF00;
+ msg->slpmsg->header->session_id = slpcall->session_id;
+ msg->slpmsg->footer->value = slpcall->app_id;
+ msg->slpmsg->header->ack_id = rand() % 0xFFFFFF00;
}
else if (slpmsg->flags == 0x100)
{
- msg->msnslp_header.ack_id = slpmsg->ack_id;
- msg->msnslp_header.ack_sub_id = slpmsg->ack_sub_id;
- msg->msnslp_header.ack_size = slpmsg->ack_size;
+ msg->slpmsg->header->ack_id = slpmsg->ack_id;
+ msg->slpmsg->header->ack_sub_id = slpmsg->ack_sub_id;
+ msg->slpmsg->header->ack_size = slpmsg->ack_size;
}
- msg->msnslp_header.id = slpmsg->id;
- msg->msnslp_header.flags = slpmsg->flags;
+ msg->slpmsg->header->id = slpmsg->id;
+ msg->slpmsg->header->flags = (guint32)slpmsg->flags;
- msg->msnslp_header.total_size = slpmsg->size;
+ msg->slpmsg->header->total_size = slpmsg->size;
passport = purple_normalize(slplink->session->account, slplink->remote_user);
msn_message_set_header(msg, "P2P-Dest", passport);
============================================================
--- libpurple/protocols/msn/slpmsg.c 205952ffc365e6441162a4e94f69c224fa73ea95
+++ libpurple/protocols/msn/slpmsg.c 99dd7d9f8a010d85f499fdced91be98fd3124d3b
@@ -172,7 +172,7 @@ msn_slpmsg_show(MsnMessage *msg)
text = FALSE;
- flags = GUINT32_TO_LE(msg->msnslp_header.flags);
+ flags = GUINT32_TO_LE(msg->slpmsg->header->flags);
switch (flags)
{
More information about the Commits
mailing list