changeset 4675:3145c5c45877

[gaim-migrate @ 4986] Okay, redid the cancel stuff. It may not work too well yet, as it's largely untested, and will need some testing and bug reporting. The protocols may not work too well (namely, Oscar), but this will be fixed soon. Note that that's only for canceling. Any receiving that currently works will continue to work. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 08 Mar 2003 08:27:02 +0000
parents 7ffe2b64de2d
children b620a67ec956
files ChangeLog src/ft.c src/ft.h src/gtkft.c src/protocols/irc/irc.c src/protocols/jabber/jabber.c src/protocols/msn/ft.c src/protocols/msn/msn.h src/protocols/oscar/oscar.c
diffstat 9 files changed, 222 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Mar 08 07:21:09 2003 +0000
+++ b/ChangeLog	Sat Mar 08 08:27:02 2003 +0000
@@ -145,7 +145,7 @@
 	* Code cleanups and fixes (Thanks, Federico Mena Quintero and 
 	  Ka-Hing Cheung)
 	* Word-wrapping on mail notification text (Thanks, Andrew Molloy)
-	* Generic File Transfer PRPL interface (Thanks, William T. Mahan)
+	* Generic File Transfer PRPL interface (Thanks, Christian Hammond)
 	* Better supression of auto-responses (Thanks, Joshua Blanton)
 	* Drag-and-drop tabs in conversations, and multiple windows with tabs
 	  in each (Thanks, Christian Hammond)
--- a/src/ft.c	Sat Mar 08 07:21:09 2003 +0000
+++ b/src/ft.c	Sat Mar 08 08:27:02 2003 +0000
@@ -64,7 +64,7 @@
 		return;
 
 	if (!xfer->completed) {
-		gaim_xfer_cancel(xfer);
+		gaim_xfer_cancel_local(xfer);
 		return;
 	}
 
@@ -416,13 +416,23 @@
 }
 
 void
-gaim_xfer_set_cancel_fnc(struct gaim_xfer *xfer,
-						 void (*fnc)(struct gaim_xfer *))
+gaim_xfer_set_cancel_send_fnc(struct gaim_xfer *xfer,
+							  void (*fnc)(struct gaim_xfer *))
 {
 	if (xfer == NULL)
 		return;
 
-	xfer->ops.cancel = fnc;
+	xfer->ops.cancel_send = fnc;
+}
+
+void
+gaim_xfer_set_cancel_recv_fnc(struct gaim_xfer *xfer,
+							  void (*fnc)(struct gaim_xfer *))
+{
+	if (xfer == NULL)
+		return;
+
+	xfer->ops.cancel_recv = fnc;
 }
 
 size_t
@@ -537,7 +547,7 @@
 
 	/* Just in case, though. */
 	if (xfer->dest_fp == NULL) {
-		gaim_xfer_cancel(xfer); /* ? */
+		gaim_xfer_cancel_local(xfer); /* ? */
 		return;
 	}
 
@@ -609,7 +619,7 @@
 
 	/* See if we are actually trying to cancel this. */
 	if (!xfer->completed) {
-		gaim_xfer_cancel(xfer);
+		gaim_xfer_cancel_local(xfer);
 		return;
 	}
 
@@ -631,15 +641,23 @@
 }
 
 void
-gaim_xfer_cancel(struct gaim_xfer *xfer)
+gaim_xfer_cancel_local(struct gaim_xfer *xfer)
 {
 	struct gaim_xfer_ui_ops *ui_ops;
 
 	if (xfer == NULL)
 		return;
 
-	if (xfer->ops.cancel != NULL)
-		xfer->ops.cancel(xfer);
+	if (gaim_xfer_get_type(xfer) == GAIM_XFER_SEND)
+	{
+		if (xfer->ops.cancel_send != NULL)
+			xfer->ops.cancel_send(xfer);
+	}
+	else
+	{
+		if (xfer->ops.cancel_recv != NULL)
+			xfer->ops.cancel_recv(xfer);
+	}
 
 	if (xfer->watcher != 0) {
 		gaim_input_remove(xfer->watcher);
@@ -656,8 +674,48 @@
 
 	ui_ops = gaim_xfer_get_ui_ops(xfer);
 
-	if (ui_ops != NULL && ui_ops->cancel != NULL)
-		ui_ops->cancel(xfer);
+	if (ui_ops != NULL && ui_ops->cancel_local != NULL)
+		ui_ops->cancel_local(xfer);
+
+	xfer->bytes_remaining = 0;
+}
+
+void
+gaim_xfer_cancel_remote(struct gaim_xfer *xfer)
+{
+	struct gaim_xfer_ui_ops *ui_ops;
+
+	if (xfer == NULL)
+		return;
+
+	if (gaim_xfer_get_type(xfer) == GAIM_XFER_SEND)
+	{
+		if (xfer->ops.cancel_send != NULL)
+			xfer->ops.cancel_send(xfer);
+	}
+	else
+	{
+		if (xfer->ops.cancel_recv != NULL)
+			xfer->ops.cancel_recv(xfer);
+	}	
+
+	if (xfer->watcher != 0) {
+		gaim_input_remove(xfer->watcher);
+		xfer->watcher = 0;
+	}
+
+	if (xfer->fd != 0)
+		close(xfer->fd);
+
+	if (xfer->dest_fp != NULL) {
+		fclose(xfer->dest_fp);
+		xfer->dest_fp = NULL;
+	}
+
+	ui_ops = gaim_xfer_get_ui_ops(xfer);
+
+	if (ui_ops != NULL && ui_ops->cancel_remote != NULL)
+		ui_ops->cancel_remote(xfer);
 
 	xfer->bytes_remaining = 0;
 }
@@ -667,7 +725,7 @@
 {
 	char *title;
 
-	if (xfer == NULL || msg == NULL || type == GAIM_XFER_UNKNOWN)
+	if (msg == NULL || type == GAIM_XFER_UNKNOWN)
 		return;
 
 	if (type == GAIM_XFER_SEND)
--- a/src/ft.h	Sat Mar 08 07:21:09 2003 +0000
+++ b/src/ft.h	Sat Mar 08 08:27:02 2003 +0000
@@ -26,7 +26,7 @@
 /**************************************************************************/
 /** Data Structures                                                       */
 /**************************************************************************/
-struct gaim_xfer *xfer;
+struct gaim_xfer;
 
 /**
  * Types of file transfers.
@@ -52,7 +52,8 @@
 	void (*ask_cancel)(struct gaim_xfer *xfer);
 	void (*add_xfer)(struct gaim_xfer *xfer);
 	void (*update_progress)(struct gaim_xfer *xfer, double percent);
-	void (*cancel)(struct gaim_xfer *xfer);
+	void (*cancel_local)(struct gaim_xfer *xfer);
+	void (*cancel_remote)(struct gaim_xfer *xfer);
 };
 
 /**
@@ -92,7 +93,8 @@
 		void (*init)(struct gaim_xfer *xfer);
 		void (*start)(struct gaim_xfer *xfer);
 		void (*end)(struct gaim_xfer *xfer);
-		void (*cancel)(struct gaim_xfer *xfer);
+		void (*cancel_send)(struct gaim_xfer *xfer);
+		void (*cancel_recv)(struct gaim_xfer *xfer);
 		size_t (*read)(char **buffer, struct gaim_xfer *xfer);
 		size_t (*write)(const char *buffer, size_t size,
 						struct gaim_xfer *xfer);
@@ -372,13 +374,22 @@
 						   void (*fnc)(struct gaim_xfer *));
 
 /**
- * Sets the cancel transfer function for the file transfer.
+ * Sets the cancel send function for the file transfer.
  *
  * @param xfer The file transfer.
- * @param fnc  The cancel transfer function.
+ * @param fnc  The cancel send function.
  */
-void gaim_xfer_set_cancel_fnc(struct gaim_xfer *xfer,
-							  void (*fnc)(struct gaim_xfer *));
+void gaim_xfer_set_cancel_send_fnc(struct gaim_xfer *xfer,
+								   void (*fnc)(struct gaim_xfer *));
+
+/**
+ * Sets the cancel receive function for the file transfer.
+ *
+ * @param xfer The file transfer.
+ * @param fnc  The cancel receive function.
+ */
+void gaim_xfer_set_cancel_recv_fnc(struct gaim_xfer *xfer,
+								   void (*fnc)(struct gaim_xfer *));
 
 /**
  * Reads in data from a file transfer stream.
@@ -425,11 +436,18 @@
 void gaim_xfer_end(struct gaim_xfer *xfer);
 
 /**
- * Cancels a file transfer.
+ * Cancels a file transfer on the local end.
  *
  * @param xfer The file transfer.
  */
-void gaim_xfer_cancel(struct gaim_xfer *xfer);
+void gaim_xfer_cancel_local(struct gaim_xfer *xfer);
+
+/**
+ * Cancels a file transfer from the remote end.
+ *
+ * @param xfer The file transfer.
+ */
+void gaim_xfer_cancel_remote(struct gaim_xfer *xfer);
 
 /**
  * Displays a file transfer-related error message.
--- a/src/gtkft.c	Sat Mar 08 07:21:09 2003 +0000
+++ b/src/gtkft.c	Sat Mar 08 08:27:02 2003 +0000
@@ -330,10 +330,10 @@
 					 struct gaim_gtkxfer_dialog *dialog)
 {
 	GtkTreeIter iter;
+	struct gaim_xfer *xfer = NULL;
 
 	if (gtk_tree_selection_get_selected(selection, NULL, &iter)) {
 		GValue val = {0, };
-		struct gaim_xfer *xfer;
 
 		gtk_widget_set_sensitive(dialog->disclosure, TRUE);
 
@@ -382,7 +382,7 @@
 static void
 stop_button_cb(GtkButton *button, struct gaim_gtkxfer_dialog *dialog)
 {
-	gaim_xfer_cancel(dialog->selected_xfer);
+	gaim_xfer_cancel_local(dialog->selected_xfer);
 }
 
 /**************************************************************************
@@ -1123,14 +1123,15 @@
 }
 
 static void
-gaim_gtkxfer_cancel(struct gaim_xfer *xfer)
+gaim_gtkxfer_cancel_local(struct gaim_xfer *xfer)
 {
 	gaim_gtkxfer_dialog_cancel_xfer(xfer_dialog, xfer);
+}
 
-	/* See if it's removed. */
-	/* XXX - This caused some looping, and I don't see a point to it */
-/*	if (xfer->ui_data == NULL)
-		gaim_xfer_destroy(xfer); */
+static void
+gaim_gtkxfer_cancel_remote(struct gaim_xfer *xfer)
+{
+	gaim_gtkxfer_dialog_cancel_xfer(xfer_dialog, xfer);
 }
 
 struct gaim_xfer_ui_ops ops =
@@ -1140,7 +1141,8 @@
 	gaim_gtkxfer_ask_cancel,
 	gaim_gtkxfer_add_xfer,
 	gaim_gtkxfer_update_progress,
-	gaim_gtkxfer_cancel
+	gaim_gtkxfer_cancel_local,
+	gaim_gtkxfer_cancel_remote
 };
 
 /**************************************************************************
--- a/src/protocols/irc/irc.c	Sat Mar 08 07:21:09 2003 +0000
+++ b/src/protocols/irc/irc.c	Sat Mar 08 08:27:02 2003 +0000
@@ -1268,7 +1268,19 @@
 }
 
 static void
-irc_xfer_cancel(struct gaim_xfer *xfer)
+irc_xfer_cancel_send(struct gaim_xfer *xfer)
+{
+	struct irc_xfer_data *data = (struct irc_xfer_data *)xfer->data;
+
+	data->idata->file_transfers = g_slist_remove(data->idata->file_transfers,
+												 xfer);
+
+	g_free(data);
+	xfer->data = NULL;
+}
+
+static void
+irc_xfer_cancel_recv(struct gaim_xfer *xfer)
 {
 	struct irc_xfer_data *data = (struct irc_xfer_data *)xfer->data;
 
@@ -1377,10 +1389,11 @@
 		g_free(filename);
 
 		/* Setup our I/O op functions. */
-		gaim_xfer_set_init_fnc(xfer,   irc_xfer_init);
-		gaim_xfer_set_end_fnc(xfer,    irc_xfer_end);
-		gaim_xfer_set_cancel_fnc(xfer, irc_xfer_cancel);
-		gaim_xfer_set_ack_fnc(xfer,    irc_xfer_ack);
+		gaim_xfer_set_init_fnc(xfer,        irc_xfer_init);
+		gaim_xfer_set_end_fnc(xfer,         irc_xfer_end);
+		gaim_xfer_set_cancel_send_fnc(xfer, irc_xfer_cancel_send);
+		gaim_xfer_set_cancel_recv_fnc(xfer, irc_xfer_cancel_recv);
+		gaim_xfer_set_ack_fnc(xfer,         irc_xfer_ack);
 
 		/* Keep track of this transfer for later. */
 		id->file_transfers = g_slist_append(id->file_transfers, xfer);
--- a/src/protocols/jabber/jabber.c	Sat Mar 08 07:21:09 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Sat Mar 08 08:27:02 2003 +0000
@@ -2015,7 +2015,10 @@
 	return 0;
 }
 
-static void jabber_xfer_cancel(struct gaim_xfer *xfer) {
+static void jabber_xfer_cancel_send(struct gaim_xfer *xfer) {
+}
+
+static void jabber_xfer_cancel_recv(struct gaim_xfer *xfer) {
 	struct jabber_xfer_data *data = xfer->data;
 	xmlnode x,y;
 
@@ -2038,6 +2041,7 @@
 static void jabber_handleoob(gjconn gjc, xmlnode iqnode) {
 	struct jabber_xfer_data *xfer_data;
 	struct jabber_data *jd = GJ_GC(gjc)->proto_data;
+	struct gaim_xfer *xfer;
 	char *msg = NULL;
 	char *filename;
 	xmlnode querynode = xmlnode_get_tag(iqnode, "query");
@@ -2072,7 +2076,8 @@
 
 	gaim_xfer_set_init_fnc(xfer,   jabber_xfer_init);
 	gaim_xfer_set_end_fnc(xfer,    jabber_xfer_end);
-	gaim_xfer_set_cancel_fnc(xfer, jabber_xfer_cancel);
+	gaim_xfer_set_cancel_send_fnc(xfer, jabber_xfer_cancel_send);
+	gaim_xfer_set_cancel_recv_fnc(xfer, jabber_xfer_cancel_recv);
 	gaim_xfer_set_read_fnc(xfer,   jabber_xfer_read);
 	gaim_xfer_set_start_fnc(xfer,  jabber_xfer_start);
 
--- a/src/protocols/msn/ft.c	Sat Mar 08 07:21:09 2003 +0000
+++ b/src/protocols/msn/ft.c	Sat Mar 08 08:27:02 2003 +0000
@@ -109,7 +109,7 @@
 		g_snprintf(sendbuf, sizeof(sendbuf), "TFR\r\n");
 
 		if (msn_write(xfer->fd, sendbuf, strlen(sendbuf)) < 0) {
-			gaim_xfer_cancel(xfer);
+			gaim_xfer_cancel_remote(xfer);
 		}
 	}
 }
@@ -140,7 +140,27 @@
 }
 
 static void
-msn_xfer_cancel(struct gaim_xfer *xfer)
+msn_xfer_cancel_send(struct gaim_xfer *xfer)
+{
+	struct gaim_account *account;
+	struct msn_xfer_data *xfer_data;
+	struct msn_data *md;
+
+	xfer_data = (struct msn_xfer_data *)xfer->data;
+
+	xfer_data->do_cancel = TRUE;
+
+	account   = gaim_xfer_get_account(xfer);
+	md        = (struct msn_data *)account->gc->proto_data;
+
+	md->file_transfers = g_slist_remove(md->file_transfers, xfer);
+
+	g_free(xfer_data);
+	xfer->data = NULL;
+}
+
+static void
+msn_xfer_cancel_recv(struct gaim_xfer *xfer)
 {
 	struct gaim_account *account;
 	struct msn_xfer_data *xfer_data;
@@ -150,20 +170,28 @@
 	xfer_data = (struct msn_xfer_data *)xfer->data;
 	md        = (struct msn_data *)account->gc->proto_data;
 
-	if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE) {
-		md->file_transfers = g_slist_remove(md->file_transfers, xfer);
+	md->file_transfers = g_slist_remove(md->file_transfers, xfer);
 
-		g_free(xfer_data);
-		xfer->data = NULL;
-	}
+	g_free(xfer_data);
+	xfer->data = NULL;
 }
 
 static size_t
 msn_xfer_read(char **buffer, struct gaim_xfer *xfer)
 {
+	struct msn_xfer_data *xfer_data;
 	unsigned char header[3];
 	size_t len, size;
 
+	xfer_data = (struct msn_xfer_data *)xfer->data;
+
+	if (xfer_data->do_cancel)
+	{
+		write(xfer->fd, "CCL\n", 4);
+
+		return 0;
+	}
+
 	if (read(xfer->fd, header, sizeof(header)) < 3) {
 		gaim_xfer_set_completed(xfer, TRUE);
 		return 0;
@@ -193,6 +221,31 @@
 static size_t
 msn_xfer_write(const char *buffer, size_t size, struct gaim_xfer *xfer)
 {
+	struct gaim_account *account;
+	struct msn_xfer_data *xfer_data;
+	struct msn_data *md;
+	unsigned char header[3];
+
+	xfer_data = (struct msn_xfer_data *)xfer->data;
+	account   = gaim_xfer_get_account(xfer);
+	md        = (struct msn_data *)account->gc->proto_data;
+
+	if (xfer_data->do_cancel)
+	{
+		header[0] = 1;
+		header[1] = 0;
+		header[2] = 0;
+
+		if (write(xfer->fd, header, sizeof(header)) < 3) {
+			gaim_xfer_cancel_remote(xfer);
+			return 0;
+		}
+	}
+	else
+	{
+		/* Not implemented yet. */
+	}
+
 	return 0;
 }
 
@@ -213,7 +266,7 @@
 				   (unsigned long)xfer_data->authcookie);
 
 		if (msn_write(source, sendbuf, strlen(sendbuf)) < 0) {
-			gaim_xfer_cancel(xfer); /* ? */
+			gaim_xfer_cancel_remote(xfer); /* ? */
 
 			return 0;
 		}
@@ -262,7 +315,7 @@
 	len = read(source, buf, sizeof(buf));
 
 	if (len <= 0) {
-		gaim_xfer_cancel(xfer);
+		gaim_xfer_cancel_remote(xfer);
 		return;
 	}
 
@@ -326,7 +379,7 @@
 		debug_printf("MSNFTP: Error establishing connection\n");
 		close(source);
 
-		gaim_xfer_cancel(xfer);
+		gaim_xfer_cancel_remote(xfer);
 
 		return;
 	}
@@ -334,7 +387,7 @@
 	g_snprintf(buf, sizeof(buf), "VER MSNFTP\r\n");
 
 	if (msn_write(source, buf, strlen(buf)) < 0) {
-		gaim_xfer_cancel(xfer);
+		gaim_xfer_cancel_remote(xfer);
 		return;
 	}
 
@@ -391,12 +444,13 @@
 		gaim_xfer_set_size(xfer, atoi(filesize_s));
 
 		/* Setup our I/O op functions */
-		gaim_xfer_set_init_fnc(xfer,   msn_xfer_init);
-		gaim_xfer_set_start_fnc(xfer,  msn_xfer_start);
-		gaim_xfer_set_end_fnc(xfer,    msn_xfer_end);
-		gaim_xfer_set_cancel_fnc(xfer, msn_xfer_cancel);
-		gaim_xfer_set_read_fnc(xfer,   msn_xfer_read);
-		gaim_xfer_set_write_fnc(xfer,  msn_xfer_write);
+		gaim_xfer_set_init_fnc(xfer,        msn_xfer_init);
+		gaim_xfer_set_start_fnc(xfer,       msn_xfer_start);
+		gaim_xfer_set_end_fnc(xfer,         msn_xfer_end);
+		gaim_xfer_set_cancel_send_fnc(xfer, msn_xfer_cancel_send);
+		gaim_xfer_set_cancel_recv_fnc(xfer, msn_xfer_cancel_recv);
+		gaim_xfer_set_read_fnc(xfer,        msn_xfer_read);
+		gaim_xfer_set_write_fnc(xfer,       msn_xfer_write);
 
 		/* Keep track of this transfer for later. */
 		md->file_transfers = g_slist_append(md->file_transfers, xfer);
@@ -452,7 +506,7 @@
 			if (proxy_connect(xfer->account, ip_s, atoi(port_s),
 							  msn_msnftp_connect, xfer) != 0) {
 
-				gaim_xfer_cancel(xfer);
+				gaim_xfer_cancel_remote(xfer);
 
 				return;
 			}
--- a/src/protocols/msn/msn.h	Sat Mar 08 07:21:09 2003 +0000
+++ b/src/protocols/msn/msn.h	Sat Mar 08 08:27:02 2003 +0000
@@ -101,6 +101,7 @@
 	uint32_t authcookie;
 
 	gboolean transferring;
+	gboolean do_cancel;
 
 	char *rxqueue;
 	int rxlen;
--- a/src/protocols/oscar/oscar.c	Sat Mar 08 07:21:09 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Sat Mar 08 08:27:02 2003 +0000
@@ -780,7 +780,7 @@
 		} else {
 			do_error_dialog(_("File Transfer Aborted"), _("Unable to establish listener socket."), GAIM_ERROR);
 			/* XXX - The below line causes a crash because the transfer is canceled before the "Ok" callback on the file selection thing exists, I think */
-			/* gaim_xfer_cancel(xfer); */
+			/* gaim_xfer_cancel_remote(xfer); */
 		}
 	} else if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE) {
 		xfer_data->conn = aim_newconn(od->sess, AIM_CONN_TYPE_RENDEZVOUS, NULL);
@@ -790,11 +790,11 @@
 			xfer_data->conn->fd = xfer->fd = proxy_connect(gc->account, xfer->remote_ip, xfer->remote_port, oscar_sendfile_connected, xfer);
 			if (xfer->fd == -1) {
 				do_error_dialog(_("File Transfer Aborted"), _("Unable to establish file descriptor."), GAIM_ERROR);
-				/* gaim_xfer_cancel(xfer); */
+				/* gaim_xfer_cancel_remote(xfer); */
 			}
 		} else {
 			do_error_dialog(_("File Transfer Aborted"), _("Unable to create new connection."), GAIM_ERROR);
-			/* gaim_xfer_cancel(xfer); */
+			/* gaim_xfer_cancel_remote(xfer); */
 			/* Try a different port? Ask them to connect to us? */
 		}
 
@@ -849,7 +849,12 @@
 }
 
 static void
-oscar_xfer_cancel(struct gaim_xfer *xfer)
+oscar_xfer_cancel_send(struct gaim_xfer *xfer)
+{
+}
+
+static void
+oscar_xfer_cancel_recv(struct gaim_xfer *xfer)
 {
 	struct gaim_connection *gc;
 	struct oscar_data *od;
@@ -969,7 +974,8 @@
 	gaim_xfer_set_init_fnc(xfer, oscar_xfer_init);
 	gaim_xfer_set_start_fnc(xfer, oscar_xfer_start);
 	gaim_xfer_set_end_fnc(xfer, oscar_xfer_end);
-	gaim_xfer_set_cancel_fnc(xfer, oscar_xfer_cancel);
+	gaim_xfer_set_cancel_send_fnc(xfer, oscar_xfer_cancel_send);
+	gaim_xfer_set_cancel_recv_fnc(xfer, oscar_xfer_cancel_recv);
 	gaim_xfer_set_ack_fnc(xfer, oscar_xfer_ack);
 
 	/* Keep track of this transfer for later */
@@ -2125,7 +2131,8 @@
 			gaim_xfer_set_init_fnc(xfer, oscar_xfer_init);
 			gaim_xfer_set_start_fnc(xfer, oscar_xfer_start);
 			gaim_xfer_set_end_fnc(xfer, oscar_xfer_end);
-			gaim_xfer_set_cancel_fnc(xfer, oscar_xfer_cancel);
+			gaim_xfer_set_cancel_send_fnc(xfer, oscar_xfer_cancel_send);
+			gaim_xfer_set_cancel_recv_fnc(xfer, oscar_xfer_cancel_recv);
 			gaim_xfer_set_ack_fnc(xfer, oscar_xfer_ack);
 
 			/*
@@ -2143,7 +2150,7 @@
 			struct gaim_xfer *xfer;
 			debug_printf("AAA - File transfer canceled by remote user\n");
 			if ((xfer = oscar_find_xfer_by_cookie(od->file_transfers, args->cookie)))
-				gaim_xfer_cancel(xfer);
+				gaim_xfer_cancel_remote(xfer);
 		} else if (args->status == AIM_RENDEZVOUS_ACCEPT) {
 			/*
 			 * This gets sent by the receiver of a file 
@@ -2584,7 +2591,7 @@
 			struct gaim_xfer *xfer;
 			debug_printf("AAA - Other user declined file transfer\n");
 			if ((xfer = oscar_find_xfer_by_cookie(od->file_transfers, cookie)))
-				gaim_xfer_cancel(xfer);
+				gaim_xfer_cancel_remote(xfer);
 		} break;
 
 		default: {
@@ -2711,7 +2718,7 @@
 #if 0
 	/* If this was a file transfer request, data is a cookie */
 	if ((xfer = oscar_find_xfer_by_cookie(od->file_transfers, data))) {
-		gaim_xfer_cancel(xfer);
+		gaim_xfer_cancel_remote(xfer);
 		return 1;
 	}
 #endif