cpw.qulogic.msnp16: 7280bc84: Attempt to simplify and clean

markdoliner at pidgin.im markdoliner at pidgin.im
Mon Feb 8 03:30:37 EST 2010


-----------------------------------------------------------------
Revision: 7280bc8445236c3ea8bce62b2ed10f8c574b93ce
Ancestor: 73551b36d48cb0819a5648c155525b08a1db41f5
Author: markdoliner at pidgin.im
Date: 2010-02-08T08:26:12
Branch: im.pidgin.cpw.qulogic.msnp16
URL: http://d.pidgin.im/viewmtn/revision/info/7280bc8445236c3ea8bce62b2ed10f8c574b93ce

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

ChangeLog: 

Attempt to simplify and clean

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slplink.c	4617ae0c46d48082ffc9fd371e5d9adb04e66040
+++ libpurple/protocols/msn/slplink.c	81b239f6505fe14c8d121f0df80bdb6f94eca83a
@@ -497,7 +497,6 @@ msn_slplink_process_msg(MsnSlpLink *slpl
 	const char *data;
 	guint64 offset;
 	gsize len;
-	PurpleXfer *xfer = NULL;
 
 	if (purple_debug_is_verbose())
 		msn_slpmsg_show(msg);
@@ -508,8 +507,11 @@ msn_slplink_process_msg(MsnSlpLink *slpl
 
 	if (msg->msnslp_header.total_size < msg->msnslp_header.length)
 	{
-		purple_debug_error("msn", "This can't be good\n");
-		g_return_if_reached();
+		/* We seem to have received a bad header */
+		purple_debug_warning("msn", "Total size listed in SLP binary header "
+				"was less than length of this particular message.  This "
+				"should not happen.  Dropping message.\n");
+		return;
 	}
 
 	data = msn_message_get_bin_data(msg, &len);
@@ -534,7 +536,7 @@ msn_slplink_process_msg(MsnSlpLink *slpl
 				if (slpmsg->flags == 0x20 ||
 				    slpmsg->flags == 0x1000020 || slpmsg->flags == 0x1000030)
 				{
-					xfer = slpmsg->slpcall->xfer;
+					PurpleXfer *xfer = slpmsg->slpcall->xfer;
 					if (xfer != NULL)
 					{
 						slpmsg->ft = TRUE;
@@ -578,10 +580,9 @@ msn_slplink_process_msg(MsnSlpLink *slpl
 
 	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);
-		purple_xfer_prpl_ready(xfer);
+		purple_xfer_prpl_ready(slpmsg->slpcall->xfer);
 	}
 	else if (slpmsg->size && slpmsg->buffer)
 	{


More information about the Commits mailing list