pidgin: da989b76: Fix Yahoo file transfers that get stuck ...

qulogic at pidgin.im qulogic at pidgin.im
Tue Jun 22 01:36:15 EDT 2010


-----------------------------------------------------------------
Revision: da989b76dd8d021004b552840e9ad62dfe970bd9
Ancestor: 51236278b5344e58692ae671bd25a862058432da
Author: qulogic at pidgin.im
Date: 2010-06-22T05:30:36
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/da989b76dd8d021004b552840e9ad62dfe970bd9

Modified files:
        ChangeLog libpurple/protocols/yahoo/yahoo_filexfer.c

ChangeLog: 

Fix Yahoo file transfers that get stuck saying \"Waiting for transfer to
begin\". The IP address and its parts should be unsigned. Also, this math
was a bit too complicated. Integer division means we don't need to care
about the fractional part.

Fixes #12213.

-------------- next part --------------
============================================================
--- ChangeLog	fe404c0bebd89ea02d7f4b6344ed2a1db91bb553
+++ ChangeLog	b08c1f481c9b8d05b9d11acaeb40d0c558197d2f
@@ -32,6 +32,8 @@ version 2.7.2 (??/??/????):
 	* Fall back to connecting to scsa.msg.yahoo.com (not configurable) if the
 	  HTTP-based connect server lookup fails.  This does not work for Yahoo
 	  JAPAN accounts.
+	* Fix file transfers that get stuck with "Waiting for transfer to
+	  begin".
 
 version 2.7.1 (05/29/2010):
 	General:
============================================================
--- libpurple/protocols/yahoo/yahoo_filexfer.c	31512c808e4059a39f28a3553fb51f4983670274
+++ libpurple/protocols/yahoo/yahoo_filexfer.c	f114dd82da4415ffe27cbf3a6f90b86e8216ff3a
@@ -983,8 +983,8 @@ static void yahoo_xfer_dns_connected_15(
 	struct yahoo_xfer_data *xd;
 	struct sockaddr_in *addr;
 	struct yahoo_packet *pkt;
-	long actaddr;
-	long a,b,c,d;
+	unsigned long actaddr;
+	unsigned char a,b,c,d;
 	PurpleConnection *gc;
 	PurpleAccount *account;
 	YahooData *yd;
@@ -1018,19 +1018,19 @@ static void yahoo_xfer_dns_connected_15(
 	/* TODO:actually, u must try with addr no.1 , if its not working addr no.2 ..... */
 	addr = hosts->data;
 	actaddr = addr->sin_addr.s_addr;
-	d = actaddr % 256;
-	actaddr = (actaddr - d) / 256;
-	c = actaddr % 256;
-	actaddr = (actaddr - c) / 256;
-	b = actaddr % 256;
-	actaddr = (actaddr - b) / 256;
-	a = actaddr;
+	d = actaddr & 0xff;
+	actaddr >>= 8;
+	c = actaddr & 0xff;
+	actaddr >>= 8;
+	b = actaddr & 0xff;
+	actaddr >>= 8;
+	a = actaddr & 0xff;
 	if(yd->jp)
 		xd->port = YAHOOJP_XFER_RELAY_PORT;
 	else
 		xd->port = YAHOO_XFER_RELAY_PORT;
 
-	url = g_strdup_printf("%ld.%ld.%ld.%ld", d, c, b, a);
+	url = g_strdup_printf("%u.%u.%u.%u", d, c, b, a);
 
 	/* Free the address... */
 	g_free(hosts->data);


More information about the Commits mailing list