Changeset 1849


Ignore:
Timestamp:
May 9, 2007, 3:05:38 AM (15 years ago)
Author:
livings124
Message:

differentiate old-style and new-style Transmission peer id (so version 1.01, etc is identified correctly)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/clients.c

    r1848 r1849  
    4747        if( !memcmp( &id[1], "TR", 2 ) )
    4848        {
    49             asprintf( &ret, "Transmission %d.%d",
    50                       charToInt( id[3] ) * 10 + charToInt( id[4] ),
    51                       charToInt( id[5] ) * 10 + charToInt( id[6] ) );
     49            /* support old-style Transmission id without maintenance number */
     50            if ( !memcmp( &id[3], "00", 2 ) )
     51            {
     52                asprintf( &ret, "Transmission 0.%d",
     53                        charToInt( id[5] ) * 10 + charToInt( id[6] ) );
     54            }
     55            else
     56            {
     57                asprintf( &ret, "Transmission %d.%c%c",
     58                        charToInt( id[3] ) * 10 + charToInt( id[4] ),
     59                        id[5], id[6] );
     60            }
    5261        }
    5362        else if( !memcmp( &id[1], "AZ", 2 ) )
Note: See TracChangeset for help on using the changeset viewer.