pidgin: 1b541845: Use the serializing function for SlpMsgP...

qulogic at pidgin.im qulogic at pidgin.im
Sun Jan 9 03:35:42 EST 2011


----------------------------------------------------------------------
Revision: 1b54184598c4fc72bfc21cd111a6c15b7e4d0f31
Parent:   307e908687637931b9f8ae0227fcd515724bdd13
Author:   qulogic at pidgin.im
Date:     01/06/11 00:12:00
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/1b54184598c4fc72bfc21cd111a6c15b7e4d0f31

Changelog: 

Use the serializing function for SlpMsgParts on a direct connection.
But it seems like a DC doesn't have a footer, which we may or may not
be parsing correctly when receiving.

Changes against parent 307e908687637931b9f8ae0227fcd515724bdd13

  patched  libpurple/protocols/msn/directconn.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/directconn.c	37dc61a3bf1f434b3a34799caf19561feeebb6b8
+++ libpurple/protocols/msn/directconn.c	5857130c322dae73b930e1a4391ee8d5cc031367
@@ -539,14 +539,12 @@ msn_dc_enqueue_part(MsnDirectConn *dc, M
 msn_dc_enqueue_part(MsnDirectConn *dc, MsnSlpMessagePart *part)
 {
 	MsnDirectConnPacket *p;
-	guint32 length;
+	size_t length;
 
-	length = part->size + P2P_PACKET_HEADER_SIZE;
-	p = msn_dc_new_packet(length);
+	p = msn_dc_new_packet(0);
+	p->data = (guchar *)msn_slpmsgpart_serialize(part, &length);
+	p->length = length - P2P_PACKET_FOOTER_SIZE; /* DC doesn't need footer? */
 
-	memcpy(p->data, part->header, P2P_PACKET_HEADER_SIZE);
-	memcpy(p->data + P2P_PACKET_HEADER_SIZE, part->buffer, part->size);
-
 	p->sent_cb = msn_dc_send_packet_cb;
 	p->part = msn_slpmsgpart_ref(part);
 


More information about the Commits mailing list