Changeset 772 for trunk/libtransmission


Ignore:
Timestamp:
Aug 14, 2006, 10:27:34 PM (15 years ago)
Author:
livings124
Message:

Lock and unlock while accessing peers in libtransmission.
Handle lack of client id in clients.h rather than the gui.

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/clients.c

    r770 r772  
    8888    if( !ret )
    8989    {
    90         asprintf( &ret, "unknown client (%c%c%c%c%c%c%c%c)",
     90        if (id[0] != 0)
     91            asprintf( &ret, "unknown client (%c%c%c%c%c%c%c%c)",
    9192                  id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7] );
     93        else
     94            asprintf( &ret, "unknown client" );
    9295    }
    9396
  • trunk/libtransmission/transmission.c

    r768 r772  
    487487tr_peer_stat_t * tr_torrentPeers( tr_torrent_t * tor, int * peerCount )
    488488{
     489    tr_lockLock( &tor->lock );
     490
    489491    *peerCount = tor->peerCount;
    490492   
     
    503505        }
    504506    }
     507   
     508    tr_lockUnlock( &tor->lock );
    505509   
    506510    return peers;
Note: See TracChangeset for help on using the changeset viewer.