bonjour: Fix large file transfers (> 4GiB) with a 64-bit libpurple. release-2.x.y

Sat, 19 Jan 2013 15:57:36 +0000

author
Linus Lüssing <linus.luessing@web.de>
date
Sat, 19 Jan 2013 15:57:36 +0000
branch
release-2.x.y
changeset 33644
9fcc56d42417
parent 33639
673056a91e3b
child 33645
c959cde2a7bd

bonjour: Fix large file transfers (> 4GiB) with a 64-bit libpurple.

Linus came up with this fix, and Daniel Atallah tweaked it to backport part of
3dea6a2d1e61789203c57800483df059b04fba4f, which contains a more complete (but
API breaking) fix.

Fixes #15421

libpurple/protocols/bonjour/bonjour_ft.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/bonjour/bonjour_ft.c	Thu Jan 17 23:57:52 2013 -0500
+++ b/libpurple/protocols/bonjour/bonjour_ft.c	Sat Jan 19 15:57:36 2013 +0000
@@ -440,7 +440,7 @@
 		if (si && (profile = xmlnode_get_attrib(si, "profile"))
 				&& !strcmp(profile, "http://jabber.org/protocol/si/profile/file-transfer")) {
 			const char *filename = NULL, *filesize_str = NULL;
-			int filesize = 0;
+			goffset filesize = 0;
 			xmlnode *file;
 
 			const char *sid = xmlnode_get_attrib(si, "id");
@@ -448,7 +448,7 @@
 			if ((file = xmlnode_get_child(si, "file"))) {
 				filename = xmlnode_get_attrib(file, "name");
 				if((filesize_str = xmlnode_get_attrib(file, "size")))
-					filesize = atoi(filesize_str);
+					filesize = g_ascii_strtoll(filesize_str, NULL, 10);
 			}
 
 			/* TODO: Make sure that it is advertising a bytestreams transfer */

mercurial