cpw.darkrain42.msn.ft: db1ffb19: Get rid of slpmsg->fp since the core is ...

qulogic at pidgin.im qulogic at pidgin.im
Mon Dec 14 02:29:40 EST 2009


-----------------------------------------------------------------
Revision: db1ffb19ec85c58cab0fe3150ea6d64a8b486bd2
Ancestor: d72b942cbcca1fc065faaa35d1db8d1e4776c04c
Author: qulogic at pidgin.im
Date: 2009-11-20T01:17:51
Branch: im.pidgin.cpw.darkrain42.msn.ft
URL: http://d.pidgin.im/viewmtn/revision/info/db1ffb19ec85c58cab0fe3150ea6d64a8b486bd2

Modified files:
        libpurple/protocols/msn/slplink.c
        libpurple/protocols/msn/slpmsg.c
        libpurple/protocols/msn/slpmsg.h

ChangeLog: 

Get rid of slpmsg->fp since the core is handling all the partial reads and
writes, and this is no longer used.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slplink.c	a4bff4ae250b81bc6bd0b0b3b3b52fa97cdb9cfd
+++ libpurple/protocols/msn/slplink.c	44b00028bc4010233d02aa8f77f242582435fdde
@@ -253,12 +253,6 @@ msn_slplink_send_msgpart(MsnSlpLink *slp
 			len = MIN(1202, slpmsg->slpcall->u.outgoing.len);
 			msn_message_set_bin_data(msg, slpmsg->slpcall->u.outgoing.data, len);
 		}
-		else if (slpmsg->fp)
-		{
-			char data[1202];
-			len = fread(data, 1, sizeof(data), slpmsg->fp);
-			msn_message_set_bin_data(msg, data, len);
-		}
 		else
 		{
 			len = slpmsg->size - slpmsg->offset;
@@ -558,7 +552,7 @@ msn_slplink_process_msg(MsnSlpLink *slpl
 				}
 			}
 		}
-		if (!slpmsg->fp && !slpmsg->ft && slpmsg->size)
+		if (!slpmsg->ft && slpmsg->size)
 		{
 			slpmsg->buffer = g_try_malloc(slpmsg->size);
 			if (slpmsg->buffer == NULL)
@@ -580,13 +574,8 @@ msn_slplink_process_msg(MsnSlpLink *slpl
 		}
 	}
 
-	if (slpmsg->fp)
+	if (slpmsg->ft)
 	{
-		/* fseek(slpmsg->fp, offset, SEEK_SET); */
-		len = fwrite(data, 1, len, slpmsg->fp);
-	}
-	else if (slpmsg->ft)
-	{
 		xfer = slpmsg->slpcall->xfer;
 		slpmsg->slpcall->u.incoming_data =
 				g_byte_array_append(slpmsg->slpcall->u.incoming_data, (const guchar *)data, len);
============================================================
--- libpurple/protocols/msn/slpmsg.c	8ee2dfefc6713b5b3a639f6a1056a89d23364850
+++ libpurple/protocols/msn/slpmsg.c	361abd2d1b20e39d67ee7b1967d44573550bf551
@@ -60,9 +60,6 @@ msn_slpmsg_destroy(MsnSlpMessage *slpmsg
 
 	slplink = slpmsg->slplink;
 
-	if (slpmsg->fp != NULL)
-		fclose(slpmsg->fp);
-
 	purple_imgstore_unref(slpmsg->img);
 
 	/* We don't want to free the data of the PurpleStoredImage,
@@ -96,7 +93,7 @@ msn_slpmsg_set_body(MsnSlpMessage *slpms
 	/* We can only have one data source at a time. */
 	g_return_if_fail(slpmsg->buffer == NULL);
 	g_return_if_fail(slpmsg->img == NULL);
-	g_return_if_fail(slpmsg->fp == NULL);
+	g_return_if_fail(slpmsg->ft == FALSE);
 
 	if (body != NULL)
 		slpmsg->buffer = g_memdup(body, size);
@@ -112,7 +109,7 @@ msn_slpmsg_set_image(MsnSlpMessage *slpm
 	/* We can only have one data source at a time. */
 	g_return_if_fail(slpmsg->buffer == NULL);
 	g_return_if_fail(slpmsg->img == NULL);
-	g_return_if_fail(slpmsg->fp == NULL);
+	g_return_if_fail(slpmsg->ft == FALSE);
 
 	slpmsg->img = purple_imgstore_ref(img);
 	slpmsg->buffer = (guchar *)purple_imgstore_get_data(img);
============================================================
--- libpurple/protocols/msn/slpmsg.h	4295ba6ce1871d80c49f6cfcd3b56bf39779c933
+++ libpurple/protocols/msn/slpmsg.h	df0fac8e9b93c0c615387d73f2b950a10c8fa426
@@ -54,7 +54,6 @@ struct _MsnSlpMessage
 	gboolean sip; /**< A flag that states if this is a SIP slp message. */
 	long flags;
 
-	FILE *fp;
 	gboolean ft;
 	PurpleStoredImage *img;
 	guchar *buffer;


More information about the Commits mailing list