pidgin: 2fa83978: Beginning a file transfer multiple times...

datallah at pidgin.im datallah at pidgin.im
Wed Oct 6 23:35:52 EDT 2010


----------------------------------------------------------------------
Revision: 2fa8397877be345efa9c19c1530ad7686236d8e4
Parent:   cecef4c1a921cb00fb6f4a4d96a5352c86369718
Author:   datallah at pidgin.im
Date:     10/06/10 23:32:53
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/2fa8397877be345efa9c19c1530ad7686236d8e4

Changelog: 

Beginning a file transfer multiple times leaks file handles.
Add some debugging and guarding to detect and avoid that.

This is only part of the full fix (mostly to help bring attention to the
problem)

The real problem is that in the MSN prpl (and possibly others), file transfers
are started multiple times.  This happens for every file transfer over MSN that
I've tested.

Refs #12660

Changes against parent cecef4c1a921cb00fb6f4a4d96a5352c86369718

  patched  libpurple/ft.c

-------------- next part --------------
============================================================
--- libpurple/ft.c	2572b6c6be0eb71ada789624391c89b1d8edb152
+++ libpurple/ft.c	89aed01fc8502b575f70a455a6853d38403486ec
@@ -1291,6 +1291,11 @@ begin_transfer(PurpleXfer *xfer, PurpleI
 	PurpleXferType type = purple_xfer_get_type(xfer);
 	PurpleXferUiOps *ui_ops = purple_xfer_get_ui_ops(xfer);
 
+	if (xfer->start_time != 0) {
+		purple_debug_error("xfer", "Transfer is being started multiple times\n");
+		g_return_if_reached();
+	}
+
 	if (ui_ops == NULL || (ui_ops->ui_read == NULL && ui_ops->ui_write == NULL)) {
 		xfer->dest_fp = g_fopen(purple_xfer_get_local_filename(xfer),
 		                        type == PURPLE_XFER_RECEIVE ? "wb" : "rb");


More information about the Commits mailing list