mirror of
https://github.com/transmission/transmission
synced 2025-02-03 04:53:27 +00:00
add Transmission's SVN version number to the id string we send the tracker
This commit is contained in:
parent
26ca860e55
commit
b1ab3968e7
1 changed files with 4 additions and 3 deletions
|
@ -54,13 +54,14 @@ tr_handle_t * tr_init( const char * tag )
|
||||||
/* Generate a peer id : "-TRxxyz-" + 12 random alphanumeric
|
/* Generate a peer id : "-TRxxyz-" + 12 random alphanumeric
|
||||||
characters, where xx is the major version number, y is the
|
characters, where xx is the major version number, y is the
|
||||||
minor version number, and z is the maintenance number (Azureus-style) */
|
minor version number, and z is the maintenance number (Azureus-style) */
|
||||||
snprintf( h->id, sizeof h->id, "-TR%02d%01d%01d-",
|
snprintf( h->id, sizeof h->id, "-TR%06d-", VERSION_REVISION );
|
||||||
VERSION_MAJOR, VERSION_MINOR, VERSION_MAINTENANCE );
|
|
||||||
for( i = 8; i < TR_ID_LEN; i++ )
|
for( i = 10; i < TR_ID_LEN; i++ )
|
||||||
{
|
{
|
||||||
r = tr_rand( 36 );
|
r = tr_rand( 36 );
|
||||||
h->id[i] = ( r < 26 ) ? ( 'a' + r ) : ( '0' + r - 26 ) ;
|
h->id[i] = ( r < 26 ) ? ( 'a' + r ) : ( '0' + r - 26 ) ;
|
||||||
}
|
}
|
||||||
|
tr_dbg( "Transmission ID is [%s]", h->id );
|
||||||
|
|
||||||
/* Random key */
|
/* Random key */
|
||||||
for( i = 0; i < TR_KEY_LEN; i++ )
|
for( i = 0; i < TR_KEY_LEN; i++ )
|
||||||
|
|
Loading…
Reference in a new issue