Blame SOURCES/pidgin-2.10.1-fix-msn-ft-crashes.patch

eb8e82
----------------------------------------------------------------------
eb8e82
Revision: 9d51cb9fbcc04d21597eed0381f4d06c53facc44
eb8e82
Parent:   17326b88b85d2f13939a71ca80d4a617f0527f9a
eb8e82
Author:   Cristi Posoiu
eb8e82
Date:     06/03/11 02:55:31
eb8e82
Branch:   im.pidgin.pidgin
eb8e82
eb8e82
Changelog: 
eb8e82
eb8e82
Fix up some cases of file transfers never finishing.  This will help certain
eb8e82
instances of Yahoo file transfers not working, but not all.  Fixes #12472.
eb8e82
eb8e82
Changes against parent 17326b88b85d2f13939a71ca80d4a617f0527f9a
eb8e82
eb8e82
  patched  libpurple/ft.c
eb8e82
eb8e82
============================================================
eb8e82
--- libpurple/ft.c	2b8633b159e16099b858dd21ed122e9c3811a9d5
eb8e82
+++ libpurple/ft.c	ffba61c0a50c9d5f866f8b1f0dec16cf13bbd65c
eb8e82
@@ -1100,9 +1100,11 @@ purple_xfer_write(PurpleXfer *xfer, cons
eb8e82
 		r = write(xfer->fd, buffer, s);
eb8e82
 		if (r < 0 && errno == EAGAIN)
eb8e82
 			r = 0;
eb8e82
-		if ((purple_xfer_get_bytes_sent(xfer)+r) >= purple_xfer_get_size(xfer))
eb8e82
-			purple_xfer_set_completed(xfer, TRUE);
eb8e82
 	}
eb8e82
+	if (r >= 0 && (purple_xfer_get_bytes_sent(xfer)+r) >= purple_xfer_get_size(xfer) &&
eb8e82
+		!purple_xfer_is_completed(xfer))
eb8e82
+		purple_xfer_set_completed(xfer, TRUE);
eb8e82
+	
eb8e82
 
eb8e82
 	return r;
eb8e82
 }