Changeset 763 for trunk/libtransmission


Ignore:
Timestamp:
Aug 13, 2006, 4:19:19 PM (15 years ago)
Author:
livings124
Message:

lock torrent before accessing peers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/transmission.c

    r754 r763  
    408408tr_peer_t * tr_getPeer( tr_torrent_t * tor, int peerNum)
    409409{
     410    tr_peer_t * peer;
     411
     412    tr_lockLock( &tor->lock );
     413   
    410414    if (peerNum < 0 || peerNum >= tor->peerCount)
    411         return NULL;
    412     return tor->peers[peerNum];
     415        peer = NULL;
     416    else
     417        peer = tor->peers[peerNum];
     418       
     419    tr_lockUnlock( &tor->lock );
     420   
     421    return peer;
    413422}
    414423
Note: See TracChangeset for help on using the changeset viewer.