1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

(libT) recognize BitSpirit peer-ids.

This commit is contained in:
Charles Kerr 2008-08-12 17:33:36 +00:00
parent fb6db8d5ef
commit 939eed339a

View file

@ -135,6 +135,18 @@ decodeBitCometClient( char * buf, size_t buflen, const uint8_t * id )
return TRUE;
}
static int
decodeBitSpiritClient( char * buf, size_t buflen, const uint8_t * id )
{
const int isBS = !memcmp( id+2, "BS", 2 );
if( isBS )
{
const int version = id[1] ? id[1] : 1;
tr_snprintf( buf, buflen, "BitSpirit v%d", version );
}
return isBS;
}
void
tr_clientForId( char * buf, size_t buflen, const void * id_in )
{
@ -291,6 +303,8 @@ tr_clientForId( char * buf, size_t buflen, const void * id_in )
if( decodeBitCometClient( buf, buflen, id ) )
return;
if( decodeBitSpiritClient( buf, buflen, id ) )
return;
/* Clients with no version */
if( !memcmp( id, "AZ2500BT", 8 ) ) no_version( buf, buflen, "BitTyrant (Azureus Mod)" );