soc.2010.msn-tlc: 9f062bc3: Drop MsnSlpHeader in favor of MsnP2pBina...

masca at cpw.pidgin.im masca at cpw.pidgin.im
Fri Jun 4 21:35:50 EDT 2010


-----------------------------------------------------------------
Revision: 9f062bc3f58c9172313bf9bd0f8641b1fb8aec8b
Ancestor: 6827410a0577c6802d9cd3bbd3360a64f11c4acd
Author: masca at cpw.pidgin.im
Date: 2010-06-03T21:41:43
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/9f062bc3f58c9172313bf9bd0f8641b1fb8aec8b

Modified files:
        libpurple/protocols/msn/directconn.c
        libpurple/protocols/msn/directconn.h
        libpurple/protocols/msn/msg.c libpurple/protocols/msn/msg.h
        libpurple/protocols/msn/slplink.c
        libpurple/protocols/msn/slplink.h

ChangeLog: 

Drop MsnSlpHeader in favor of MsnP2pBinaryHeader.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/directconn.c	a42bdcc1c535ab6f7d212214c050f34924bf47be
+++ libpurple/protocols/msn/directconn.c	13bd0ad010cd9ad401de1b5b218b3bb247c034e4
@@ -340,7 +340,7 @@ msn_dc_parse_binary_header(MsnDirectConn
 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 @@ msn_dc_serialize_binary_header(MsnDirect
 
 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);
============================================================
--- libpurple/protocols/msn/directconn.h	8b56d2d2e95dd59e247a371807a5889e107e2a38
+++ libpurple/protocols/msn/directconn.h	9099a5aed644ee2b7a6b30b7b205b877a482e562
@@ -100,7 +100,7 @@ struct _MsnDirectConn
 	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 *);
============================================================
--- libpurple/protocols/msn/msg.c	9ebf6a0fedf0de21c281184e0babb007eba68bce
+++ libpurple/protocols/msn/msg.c	6f86c4b9b3b4879d26c03d3317baebc29368f675
@@ -163,7 +163,7 @@ msn_message_parse_slp_body(MsnMessage *m
 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 @@ msn_message_parse_payload(MsnMessage *ms
 	if (content_type != NULL &&
 		!strcmp(content_type, "application/x-msnmsgrp2p"))
 	{
-		MsnSlpHeader header;
+		MsnP2PBinaryHeader header;
 		MsnSlpFooter footer;
 		int body_len;
 
@@ -384,7 +384,7 @@ msn_message_gen_slp_body(MsnMessage *msg
 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 @@ msn_message_gen_payload(MsnMessage *msg,
 
 	if (msg->msnslp_message)
 	{
-		MsnSlpHeader header;
+		MsnP2PBinaryHeader header;
 		MsnSlpFooter footer;
 
 		header.session_id = GUINT32_TO_LE(msg->msnslp_header.session_id);
============================================================
--- libpurple/protocols/msn/msg.h	3de3f539b888ce0bb26b84a7a8e1f0070bde3f84
+++ libpurple/protocols/msn/msg.h	6dd6b7f37f2bf09eab4183d9b518b24d5650d69f
@@ -58,6 +58,7 @@ typedef enum
 #include "session.h"
 #include "transaction.h"
 #include "user.h"
+#include "p2p.h"
 
 typedef void (*MsnMsgCb)(MsnMessage *, void *data);
 
@@ -69,19 +70,6 @@ typedef struct
 
 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 @@ struct _MsnMessage
 	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;
============================================================
--- libpurple/protocols/msn/slplink.c	18ec3f7b96fcc64b85bba3dc1119b4fd57930655
+++ libpurple/protocols/msn/slplink.c	1a5634fa8e93ee6c30adfde0bb08bd1d65573fc7
@@ -493,7 +493,7 @@ static MsnSlpMessage *
 }
 
 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
 }
 
 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
 }
 
 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;
============================================================
--- libpurple/protocols/msn/slplink.h	3029144787411e28c9b1d5e04db50114b09000e3
+++ libpurple/protocols/msn/slplink.h	75e772facbe1708e33b3324839306a5df671f472
@@ -81,7 +81,7 @@ void msn_slplink_send_queued_slpmsgs(Msn
 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);


More information about the Commits mailing list