changeset 28795:bffe098efca2

Calling purple_xfer_start may actually cancel the transfer (if the file was deleted, for example), so don't continue to do stuff if it was. Refs #6523, but doesn't yet fix it.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 14 Dec 2009 05:24:20 +0000
parents 65a71af04b55
children 5d8867f11f0d
files libpurple/protocols/msn/slplink.c
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slplink.c	Mon Dec 14 04:12:34 2009 +0000
+++ b/libpurple/protocols/msn/slplink.c	Mon Dec 14 05:24:20 2009 +0000
@@ -141,9 +141,11 @@
 	g_return_val_if_fail(username != NULL, NULL);
 
 	slplink = msn_session_find_slplink(session, username);
+	purple_debug_info("msn", "Hey, we got a slplink: %p\n", slplink);
 
 	if (slplink == NULL)
 		slplink = msn_slplink_new(session, username);
+	purple_debug_info("msn", "Hey, the slplink's really: %p\n", slplink);
 
 	return slplink;
 }
@@ -456,13 +458,19 @@
 	MsnSlpMessage *slpmsg;
 	PurpleXfer *xfer;
 
+	xfer = (PurpleXfer *)slpcall->xfer;
+	purple_xfer_ref(xfer);
+	purple_xfer_start(xfer, -1, NULL, 0);
+	if (purple_xfer_get_status(xfer) != PURPLE_XFER_STATUS_STARTED) {
+		purple_xfer_unref(xfer);
+		return;
+	}
+	purple_xfer_unref(xfer);
+
 	slpmsg = msn_slpmsg_new(slpcall->slplink);
 	slpmsg->slpcall = slpcall;
 	slpmsg->flags = 0x1000030;
 	slpmsg->info = "SLP FILE";
-
-	xfer = (PurpleXfer *)slpcall->xfer;
-	purple_xfer_start(slpcall->xfer, -1, NULL, 0);
 	slpmsg->size = purple_xfer_get_size(xfer);
 
 	msn_slplink_send_slpmsg(slpcall->slplink, slpmsg);