Ignore:
Timestamp:
Apr 3, 2007, 6:22:58 PM (15 years ago)
Author:
joshe
Message:

Cache peer client name.
Don't create an 'unknown client' name with nonprintable characters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/clients.c

    r1648 r1650  
    321321    if( !ret )
    322322    {
    323         if( id[0] != 0 )
     323        if( isprint( id[0] ) && isprint( id[1] ) && isprint( id[2] ) &&
     324            isprint( id[3] ) && isprint( id[4] ) && isprint( id[5] ) &&
     325            isprint( id[6] ) && isprint( id[7] ) )
    324326        {
    325327            asprintf( &ret, "unknown client (%c%c%c%c%c%c%c%c)",
     
    328330        else
    329331        {
    330             asprintf( &ret, "unknown client" );
     332            asprintf( &ret, "unknown client (0x%02x%02x%02x%02x%02x%02x%02x%02x",
     333                  id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7] );
    331334        }
    332335    }
Note: See TracChangeset for help on using the changeset viewer.