Opened 15 years ago

Closed 15 years ago

#157 closed Defect (fixed)

Detection and reporting of bittornado-style peerid needs updating

Reported by: trager Owned by: somebody
Priority: Normal Milestone: Sometime
Component: Transmission Version: 0.6
Severity: Normal Keywords:
Cc:

Description

Although the BitTorrentSpecification states: "Shadow's style uses the following encoding: one ascii alphanumeric for client identification, three ascii digits for version number, '----', followed by random numbers.", that's not accurate (anymore).

I keep seeing peerids like T03F--00, or A03F--00. They are reported as unknown, but are valid BitTornado? and ABC client ids, respectively. Look at how the mainline BitTorrent? client identifies BitTornado?: ('T(?P<version>%s)0?-+.+$'%v64p , "BitTornado" ),.

Also, for the ids that Transmission does correctly identify, the version should be hex decoded like Azureus does:

  private static String decodeTornadoStyle( byte[] id, String ident, String name ) {
    try {
     if( (id[4] == (byte)45) && (id[5] == (byte)45) ) {
      if( (id[6] == (byte)45) && (id[7] == (byte)45) && (id[8] == (byte)45)) {
        String decoded = new String( id, 0, 1, Constants.BYTE_ENCODING );
        if( decoded.equals( ident ) ) {
          int v1 = Integer.parseInt( new String( id, 1, 1, Constants.BYTE_ENCODING ), 16 );
          int v2 = Integer.parseInt( new String( id, 2, 1, Constants.BYTE_ENCODING ), 16 );
          int v3 = Integer.parseInt( new String( id, 3, 1, Constants.BYTE_ENCODING ), 16 );
          return name + " " + v1 + "." + v2 + "." + v3;
        }
      }
      
      if( (id[6] == (byte)48) ) {
          String decoded = new String( id, 0, 1, Constants.BYTE_ENCODING );
          if( decoded.equals( ident ) ) {
            int v1 = Integer.parseInt( new String( id, 1, 1, Constants.BYTE_ENCODING ), 16 );
            int v2 = Integer.parseInt( new String( id, 2, 1, Constants.BYTE_ENCODING ), 16 );
            int v3 = Integer.parseInt( new String( id, 3, 1, Constants.BYTE_ENCODING ), 16 );
            if(ident.equals("T")){
            	return name + " LM" + " " + v1 + "." + v2 + "." + v3;
            } else {
            	return name +  " " + v1 + "." + v2 + "." + v3;
            }
          }
        }
     }
     if( (id[4] == (byte)48) && (id[5] == (byte)45) && (id[6] == (byte)45)  ) {
         String decoded = new String( id, 0, 1, Constants.BYTE_ENCODING );
         if( decoded.equals( ident ) ) {
           return "TorrentFlux";
         }
     }
    }
    catch( Exception e ) {  return null;  }
    return null;
  }

so 03F should be reported as the latest cvs version: .3.15

Change History (2)

comment:1 Changed 15 years ago by livings124

This should be fixed.

comment:2 Changed 15 years ago by livings124

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.