# HG changeset patch # User masca@cpw.pidgin.im # Date 1275601303 0 # Node ID 4a8ebd7ed879cb3c573f28ebaa957a5302e3e69f # Parent d4869cd866801d93ba1adfdf39feb772ac1c2c71 Drop MsnSlpHeader in favor of MsnP2pBinaryHeader. diff -r d4869cd86680 -r 4a8ebd7ed879 libpurple/protocols/msn/directconn.c --- a/libpurple/protocols/msn/directconn.c Thu Jun 03 21:18:53 2010 +0000 +++ b/libpurple/protocols/msn/directconn.c Thu Jun 03 21:41:43 2010 +0000 @@ -340,7 +340,7 @@ static void msn_dc_parse_binary_header(MsnDirectConn *dc) { - MsnSlpHeader *h; + MsnP2PBinaryHeader *h; MsnP2PBinaryHeader *context; g_return_if_fail(dc != NULL); @@ -362,7 +362,7 @@ static const gchar * msn_dc_serialize_binary_header(MsnDirectConn *dc) { - MsnSlpHeader *h; + MsnP2PBinaryHeader *h; static MsnP2PBinaryHeader bin_header; g_return_val_if_fail(dc != NULL, NULL); diff -r d4869cd86680 -r 4a8ebd7ed879 libpurple/protocols/msn/directconn.h --- a/libpurple/protocols/msn/directconn.h Thu Jun 03 21:18:53 2010 +0000 +++ b/libpurple/protocols/msn/directconn.h Thu Jun 03 21:41:43 2010 +0000 @@ -100,7 +100,7 @@ GQueue *out_queue; /**< The outgoing packet queue */ int msg_pos; /**< The position of next byte to be sent in the actual packet */ - MsnSlpHeader header; /**< SLP header for parsing / serializing */ + MsnP2PBinaryHeader header; /**< SLP header for parsing / serializing */ /** The callback used for sending information to the peer about the opened socket */ void (*send_connection_info_msg_cb)(MsnDirectConn *); diff -r d4869cd86680 -r 4a8ebd7ed879 libpurple/protocols/msn/msg.c --- a/libpurple/protocols/msn/msg.c Thu Jun 03 21:18:53 2010 +0000 +++ b/libpurple/protocols/msn/msg.c Thu Jun 03 21:41:43 2010 +0000 @@ -163,7 +163,7 @@ void msn_message_parse_slp_body(MsnMessage *msg, const char *body, size_t len) { - MsnSlpHeader header; + MsnP2PBinaryHeader header; const char *tmp; int body_len; @@ -298,7 +298,7 @@ if (content_type != NULL && !strcmp(content_type, "application/x-msnmsgrp2p")) { - MsnSlpHeader header; + MsnP2PBinaryHeader header; MsnSlpFooter footer; int body_len; @@ -384,7 +384,7 @@ char * msn_message_gen_slp_body(MsnMessage *msg, size_t *ret_size) { - MsnSlpHeader header; + MsnP2PBinaryHeader header; char *tmp, *base; const void *body; @@ -475,7 +475,7 @@ if (msg->msnslp_message) { - MsnSlpHeader header; + MsnP2PBinaryHeader header; MsnSlpFooter footer; header.session_id = GUINT32_TO_LE(msg->msnslp_header.session_id); diff -r d4869cd86680 -r 4a8ebd7ed879 libpurple/protocols/msn/msg.h --- a/libpurple/protocols/msn/msg.h Thu Jun 03 21:18:53 2010 +0000 +++ b/libpurple/protocols/msn/msg.h Thu Jun 03 21:41:43 2010 +0000 @@ -58,6 +58,7 @@ #include "session.h" #include "transaction.h" #include "user.h" +#include "p2p.h" typedef void (*MsnMsgCb)(MsnMessage *, void *data); @@ -69,19 +70,6 @@ typedef struct { - guint32 session_id; - guint32 id; - guint64 offset; - guint64 total_size; - guint32 length; - guint32 flags; - guint32 ack_id; - guint32 ack_sub_id; - guint64 ack_size; -} MsnSlpHeader; - -typedef struct -{ guint32 value; } MsnSlpFooter; @@ -106,7 +94,7 @@ guint total_chunks; /**< How many chunks in this multi-part message */ guint received_chunks; /**< How many chunks we've received so far */ - MsnSlpHeader msnslp_header; + MsnP2PBinaryHeader msnslp_header; MsnSlpFooter msnslp_footer; GHashTable *header_table; diff -r d4869cd86680 -r 4a8ebd7ed879 libpurple/protocols/msn/slplink.c --- a/libpurple/protocols/msn/slplink.c Thu Jun 03 21:18:53 2010 +0000 +++ b/libpurple/protocols/msn/slplink.c Thu Jun 03 21:41:43 2010 +0000 @@ -493,7 +493,7 @@ } static MsnSlpMessage * -msn_slplink_create_ack(MsnSlpLink *slplink, MsnSlpHeader *header) +msn_slplink_create_ack(MsnSlpLink *slplink, MsnP2PBinaryHeader *header) { MsnSlpMessage *slpmsg; @@ -511,7 +511,7 @@ } static void -msn_slplink_send_ack(MsnSlpLink *slplink, MsnSlpHeader *header) +msn_slplink_send_ack(MsnSlpLink *slplink, MsnP2PBinaryHeader *header) { MsnSlpMessage *slpmsg = msn_slplink_create_ack(slplink, header); @@ -563,7 +563,7 @@ } void -msn_slplink_process_msg(MsnSlpLink *slplink, MsnSlpHeader *header, const char *data, gsize len) +msn_slplink_process_msg(MsnSlpLink *slplink, MsnP2PBinaryHeader *header, const char *data, gsize len) { MsnSlpMessage *slpmsg; guint64 offset; diff -r d4869cd86680 -r 4a8ebd7ed879 libpurple/protocols/msn/slplink.h --- a/libpurple/protocols/msn/slplink.h Thu Jun 03 21:18:53 2010 +0000 +++ b/libpurple/protocols/msn/slplink.h Thu Jun 03 21:41:43 2010 +0000 @@ -81,7 +81,7 @@ void msn_slplink_send_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); void msn_slplink_send_queued_slpmsgs(MsnSlpLink *slplink); -void msn_slplink_process_msg(MsnSlpLink *slplink, MsnSlpHeader *header, const char *data, gsize len); +void msn_slplink_process_msg(MsnSlpLink *slplink, MsnP2PBinaryHeader *header, const char *data, gsize len); void msn_slplink_request_ft(MsnSlpLink *slplink, PurpleXfer *xfer); void msn_slplink_send_msg(MsnSlpLink *slplink, MsnMessage *msg);