diff libpurple/ft.c @ 30590:485eaf544bb0

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
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 07 Oct 2010 03:32:53 +0000
parents 1cdae196aac8
children a76cf8ecb0c5
line wrap: on
line diff
--- a/libpurple/ft.c	Thu Oct 07 02:02:15 2010 +0000
+++ b/libpurple/ft.c	Thu Oct 07 03:32:53 2010 +0000
@@ -1291,6 +1291,11 @@
 	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");