Ignore:
Timestamp:
May 13, 2006, 6:48:37 AM (16 years ago)
Author:
titer
Message:

Adds automatic peer banning.
At first, peers get only banned for the bad pieces they've contributed to, i.e. we continue to ask them for other parts of the torrent. If more bad data keeps coming, the peer gets completely banned.
Based on Jeremiah Morris' patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peerutils.h

    r65 r253  
    268268            continue;
    269269        }
     270        if( peer->banfield && tr_bitfieldHas( peer->banfield, i ) )
     271        {
     272            /* The peer is banned for this piece */
     273            continue;
     274        }
    270275
    271276        /* We are interested in this piece, remember it */
     
    348353            continue;
    349354        }
     355        if( peer->banfield && tr_bitfieldHas( peer->banfield, i ) )
     356        {
     357            /* The peer is banned for this piece */
     358            continue;
     359        }
    350360        if( tr_cpPieceIsComplete( tor->completion, i ) )
    351361        {
Note: See TracChangeset for help on using the changeset viewer.