# HG changeset patch # User Elliott Sales de Andrade # Date 1277184636 0 # Node ID d0b0f0d17046b449bef181febd09dadb4aded1b5 # Parent 91869ed3ba592df823c75a08547657fb22a893c6 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. diff -r 91869ed3ba59 -r d0b0f0d17046 ChangeLog --- a/ChangeLog Tue Jun 22 01:40:18 2010 +0000 +++ b/ChangeLog Tue Jun 22 05:30:36 2010 +0000 @@ -32,6 +32,8 @@ * 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: diff -r 91869ed3ba59 -r d0b0f0d17046 libpurple/protocols/yahoo/yahoo_filexfer.c --- a/libpurple/protocols/yahoo/yahoo_filexfer.c Tue Jun 22 01:40:18 2010 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Tue Jun 22 05:30:36 2010 +0000 @@ -983,8 +983,8 @@ 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 @@ /* 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);