soc.2008.yahoo: d27a0adf: fix a bug in libpurple that prevented re...

sulabh at soc.pidgin.im sulabh at soc.pidgin.im
Wed Jan 28 02:40:25 EST 2009


-----------------------------------------------------------------
Revision: d27a0adfd8ba41482c30ce87c25f434d4d7eb3de
Ancestor: 20c0464d0386bda43b1e1c0655813a7a61a30713
Author: sulabh at soc.pidgin.im
Date: 2009-01-28T07:34:18
Branch: im.pidgin.soc.2008.yahoo
URL: http://d.pidgin.im/viewmtn/revision/info/d27a0adfd8ba41482c30ce87c25f434d4d7eb3de

Modified files:
        libpurple/ft.c

ChangeLog: 

fix a bug in libpurple that prevented receiving file transfers to be marked completed (in case the protocol uses an xfer->ops.read function)

-------------- next part --------------
============================================================
--- libpurple/ft.c	aecce343eddea0923459c04b16f5f6ed78acca27
+++ libpurple/ft.c	579a141bfbbbbe1c75e5e423254cbfc8c9256af2
@@ -857,8 +857,12 @@ purple_xfer_read(PurpleXfer *xfer, gucha
 	else
 		s = MIN(purple_xfer_get_bytes_remaining(xfer), xfer->current_buffer_size);
 
-	if (xfer->ops.read != NULL)
+	if (xfer->ops.read != NULL)	{
 		r = (xfer->ops.read)(buffer, xfer);
+		if ((purple_xfer_get_size(xfer) > 0) &&
+			((purple_xfer_get_bytes_sent(xfer)+r) >= purple_xfer_get_size(xfer)))
+			purple_xfer_set_completed(xfer, TRUE);
+	}
 	else {
 		*buffer = g_malloc0(s);
 


More information about the Commits mailing list