Changeset 13097


Ignore:
Timestamp:
Nov 22, 2011, 3:02:18 AM (10 years ago)
Author:
livings124
Message:

#4643 Support µTorrent's long-version-number peer id

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/clients.c

    r12502 r13097  
    305305    }
    306306
     307    /* uTorrent will replace the training dash for an extra digit for longer version numbers */
     308    if( id[0] == '-' )
     309    {
     310        if( !memcmp( id+1, "UT", 2 ) )
     311        {
     312            tr_snprintf( buf, buflen, "\xc2\xb5Torrent %d.%d.%d%s",
     313                        strint(id+3,1), strint(id+4,1), strint(id+5,2), getMnemonicEnd(id[7]) );
     314        }
     315        else if( !memcmp( id+1, "UM", 2 ) )
     316        {
     317            tr_snprintf( buf, buflen, "\xc2\xb5Torrent Mac %d.%d.%d%s",
     318                        strint(id+3,1), strint(id+4,1), strint(id+5,2), getMnemonicEnd(id[7]) );
     319        }
     320        else if( !memcmp( id+1, "UE", 2 ) )
     321        {
     322            tr_snprintf( buf, buflen, "\xc2\xb5Torrent Embedded %d.%d.%d%s",
     323                        strint(id+3,1), strint(id+4,1), strint(id+5,2), getMnemonicEnd(id[7]) );
     324        }
     325
     326        if( *buf )
     327            return;
     328    }
     329
    307330    /* Mainline */
    308331    if( isMainlineStyle( id ) )
Note: See TracChangeset for help on using the changeset viewer.