From 939eed339a5f228202984d1b39c53f6576ccb03f Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 12 Aug 2008 17:33:36 +0000 Subject: [PATCH] (libT) recognize BitSpirit peer-ids. --- libtransmission/clients.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libtransmission/clients.c b/libtransmission/clients.c index cd280242b..23963c0be 100644 --- a/libtransmission/clients.c +++ b/libtransmission/clients.c @@ -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)" );