/soc/2013/ashmew2/filetransferY: 726db23cd73b: XFER_RECEIVE Work...

Ashish Gupta ashmew2 at gmail.com
Sun Feb 16 07:07:15 EST 2014


Changeset: 726db23cd73bfdc632209388b2593ac3ed512f25
Author:	 Ashish Gupta <ashmew2 at gmail.com>
Date:	 2014-02-16 17:34 +0530
Branch:	 default
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferY/rev/726db23cd73b

Description:

XFER_RECEIVE Works now. FT API Changed.

diffstat:

 libpurple/xfer.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (32 lines):

diff --git a/libpurple/xfer.c b/libpurple/xfer.c
--- a/libpurple/xfer.c
+++ b/libpurple/xfer.c
@@ -1353,7 +1353,7 @@ do_transfer(PurpleXfer *xfer)
 			}
 
 			if ((purple_xfer_get_size(xfer) > 0) &&
-				((purple_xfer_get_bytes_sent(xfer)+r) >= purple_xfer_get_size(xfer)))
+				((purple_xfer_get_bytes_sent(xfer)) >= purple_xfer_get_size(xfer)))
 				purple_xfer_set_completed(xfer, TRUE);
 		} else if(r < 0) {
 			purple_xfer_cancel_remote(xfer);
@@ -1446,7 +1446,18 @@ do_transfer(PurpleXfer *xfer)
 		}
 	}
 
-	if (r > 0) {
+	if(r>0 && priv->type == PURPLE_XFER_TYPE_RECEIVE) {
+		if (priv->ops.ack != NULL)
+			priv->ops.ack(xfer, buffer, r);
+
+		g_free(buffer);
+
+		if (ui_ops != NULL && ui_ops->update_progress != NULL)
+			ui_ops->update_progress(xfer,
+				purple_xfer_get_progress(xfer));
+	}
+
+	if (r > 0 && priv->type == PURPLE_XFER_TYPE_SEND) {
 		purple_xfer_set_bytes_sent(xfer, priv->bytes_sent + r);
 
 		if (priv->ops.ack != NULL)



More information about the Commits mailing list