pidgin: 700a97f5: Calling purple_xfer_start may actually c...

qulogic at pidgin.im qulogic at pidgin.im
Mon Dec 14 02:27:42 EST 2009


-----------------------------------------------------------------
Revision: 700a97f591b7815717184f6ea2fbee1de00577fc
Ancestor: f2ad41d4120295749ac19717872f8f5549093aa4
Author: qulogic at pidgin.im
Date: 2009-12-14T05:24:20
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/700a97f591b7815717184f6ea2fbee1de00577fc

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

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slplink.c	5cb8d5f26d0c56f184ebc0f102421cf6acc896b2
+++ libpurple/protocols/msn/slplink.c	d7c9e917dead2564051195b071447b36c604a409
@@ -141,9 +141,11 @@ msn_session_get_slplink(MsnSession *sess
 	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 @@ send_file_cb(MsnSlpCall *slpcall)
 	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);


More information about the Commits mailing list