mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
#4643 Support µTorrent's long-version-number peer id
This commit is contained in:
parent
c674378499
commit
caa1c8fb8f
1 changed files with 23 additions and 0 deletions
|
@ -304,6 +304,29 @@ tr_clientForId( char * buf, size_t buflen, const void * id_in )
|
|||
return;
|
||||
}
|
||||
|
||||
/* uTorrent will replace the training dash for an extra digit for longer version numbers */
|
||||
if( id[0] == '-' )
|
||||
{
|
||||
if( !memcmp( id+1, "UT", 2 ) )
|
||||
{
|
||||
tr_snprintf( buf, buflen, "\xc2\xb5Torrent %d.%d.%d%s",
|
||||
strint(id+3,1), strint(id+4,1), strint(id+5,2), getMnemonicEnd(id[7]) );
|
||||
}
|
||||
else if( !memcmp( id+1, "UM", 2 ) )
|
||||
{
|
||||
tr_snprintf( buf, buflen, "\xc2\xb5Torrent Mac %d.%d.%d%s",
|
||||
strint(id+3,1), strint(id+4,1), strint(id+5,2), getMnemonicEnd(id[7]) );
|
||||
}
|
||||
else if( !memcmp( id+1, "UE", 2 ) )
|
||||
{
|
||||
tr_snprintf( buf, buflen, "\xc2\xb5Torrent Embedded %d.%d.%d%s",
|
||||
strint(id+3,1), strint(id+4,1), strint(id+5,2), getMnemonicEnd(id[7]) );
|
||||
}
|
||||
|
||||
if( *buf )
|
||||
return;
|
||||
}
|
||||
|
||||
/* Mainline */
|
||||
if( isMainlineStyle( id ) )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue