pidgin: 5143a681: Update XMPP for 64-bit transfers.

qulogic at pidgin.im qulogic at pidgin.im
Sun Oct 16 04:25:46 EDT 2011


----------------------------------------------------------------------
Revision: 5143a681a5993c9573b38887234214d9336297e4
Parent:   f0f3e38fc3b9214c39a0e413f9d2ff5666a389c7
Author:   qulogic at pidgin.im
Date:     10/16/11 02:52:12
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5143a681a5993c9573b38887234214d9336297e4

Changelog: 

Update XMPP for 64-bit transfers.

Refs #8477.

Changes against parent f0f3e38fc3b9214c39a0e413f9d2ff5666a389c7

  patched  libpurple/protocols/jabber/oob.c
  patched  libpurple/protocols/jabber/si.c

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/oob.c	889b556a8d6638be3c76e9901611c2bf24eabaaf
+++ libpurple/protocols/jabber/oob.c	5d5a7f04cc1ace30705632c8215e8f9aece54194
@@ -137,8 +137,8 @@ static gssize jabber_oob_xfer_read(gucha
 			*tmp = '\0';
 			lenstr = strstr(jox->headers->str, "Content-Length: ");
 			if(lenstr) {
-				int size;
-				sscanf(lenstr, "Content-Length: %d", &size);
+				goffset size;
+				sscanf(lenstr, "Content-Length: %" G_GOFFSET_FORMAT, &size);
 				purple_xfer_set_size(xfer, size);
 			}
 			purple_xfer_set_read_fnc(xfer, NULL);
============================================================
--- libpurple/protocols/jabber/si.c	634915774a1c9629da2a9b376d4de15668d2e02a
+++ libpurple/protocols/jabber/si.c	fbe46f28afa0286dab1fcf7c739a1b66a95714a5
@@ -1099,7 +1099,7 @@ jabber_si_xfer_ibb_sent_cb(JabberIBBSess
 jabber_si_xfer_ibb_sent_cb(JabberIBBSession *sess)
 {
 	PurpleXfer *xfer = (PurpleXfer *) jabber_ibb_session_get_user_data(sess);
-	gsize remaining = purple_xfer_get_bytes_remaining(xfer);
+	goffset remaining = purple_xfer_get_bytes_remaining(xfer);
 
 	if (remaining == 0) {
 		/* close the session */
@@ -1240,7 +1240,7 @@ static void jabber_si_xfer_send_request(
 	file = xmlnode_new_child(si, "file");
 	xmlnode_set_namespace(file, NS_SI_FILE_TRANSFER);
 	xmlnode_set_attrib(file, "name", purple_xfer_get_filename(xfer));
-	g_snprintf(buf, sizeof(buf), "%" G_GSIZE_FORMAT, purple_xfer_get_size(xfer));
+	g_snprintf(buf, sizeof(buf), "%" G_GOFFSET_FORMAT, purple_xfer_get_size(xfer));
 	xmlnode_set_attrib(file, "size", buf);
 	/* maybe later we'll do hash and date attribs */
 
@@ -1676,8 +1676,7 @@ void jabber_si_parse(JabberStream *js, c
 	xmlnode *thumbnail;
 #endif
 	const char *stream_id, *filename, *filesize_c, *profile;
-	guint64 filesize_64 = 0;
-	size_t filesize = 0;
+	goffset filesize = 0;
 
 	if(!(profile = xmlnode_get_attrib(si, "profile")) ||
 			strcmp(profile, NS_SI_FILE_TRANSFER))
@@ -1693,17 +1692,7 @@ void jabber_si_parse(JabberStream *js, c
 		return;
 
 	if((filesize_c = xmlnode_get_attrib(file, "size")))
-		filesize_64 = g_ascii_strtoull(filesize_c, NULL, 10);
-	/* TODO 3.0.0: When the core uses a guint64, this is redundant.
-	 * See #8477.
-	 */
-	if (filesize_64 > G_MAXSIZE) {
-		/* Should this pop up a warning? */
-		purple_debug_warning("jabber", "Unable to transfer file (too large)"
-		                     " -- see #8477 for more details.");
-		return;
-	}
-	filesize = filesize_64;
+		filesize = g_ascii_strtoull(filesize_c, NULL, 10);
 
 	if(!(feature = xmlnode_get_child(si, "feature")))
 		return;


More information about the Commits mailing list