(libT) recognize BitSpirit peer-ids.

This commit is contained in:
Charles Kerr 2008-08-12 17:33:36 +00:00
parent fb6db8d5ef
commit 939eed339a
1 changed files with 14 additions and 0 deletions

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)" );