Ignore:
Timestamp:
Apr 19, 2008, 7:37:05 PM (14 years ago)
Author:
charles
Message:

peer-msgs: faster upload speeds in situations with few peers. this patch needs wider testing for side-effects wrt speed limits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r5647 r5650  
    995995}
    996996
    997 static void
    998 maybeEnsureAtomExists( Torrent * t, const struct in_addr * addr, uint16_t port, uint8_t flags, uint8_t from )
    999 {
    1000     if( tr_blocklistHasAddress( t->manager->handle, addr ) )
    1001     {
    1002         char * fmt = NULL;
    1003         switch( from ) {
    1004             case TR_PEER_FROM_TRACKER:  fmt = _( "Banned IP address \"%s\" was given to us by the tracker" ); break;
    1005             case TR_PEER_FROM_CACHE:    fmt = _( "Banned IP address \"%s\" was found in the cache" ); break;
    1006             case TR_PEER_FROM_PEX:      fmt = _( "Banned IP address \"%s\" was given to us by another peer" ); break;
    1007             case TR_PEER_FROM_INCOMING: fmt = _( "Banned IP address \"%s\" tried to connect to us" ); break;
    1008         }
    1009         tr_torinf( t->tor, fmt, inet_ntoa( *addr ) );
    1010     }
    1011     else
    1012     {
    1013         ensureAtomExists( t, addr, port, flags, from );
    1014     }
    1015 }
    1016 
    1017997static int
    1018998getMaxPeerCount( const tr_torrent * tor UNUSED )
     
    11201100    if( tr_blocklistHasAddress( manager->handle, addr ) )
    11211101    {
    1122         tr_inf( _( "Banned IP address \"%s\" tried to connect to us" ),
     1102        tr_dbg( "Banned IP address \"%s\" tried to connect to us",
    11231103                inet_ntoa( *addr ) );
    11241104        tr_netClose( socket );
     
    11581138
    11591139    t = getExistingTorrent( manager, torrentHash );
    1160     maybeEnsureAtomExists( t, &pex->in_addr, pex->port, pex->flags, from );
     1140    if( !tr_blocklistHasAddress( t->manager->handle, &pex->in_addr ) )
     1141        ensureAtomExists( t, &pex->in_addr, pex->port, pex->flags, from );
    11611142
    11621143    managerUnlock( manager );
Note: See TracChangeset for help on using the changeset viewer.