changeset 31025: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 de168bbf1e43
children 8ada5c6f305d
files libpurple/ft.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
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");