Changeset 5650
- Timestamp:
- Apr 19, 2008, 7:37:05 PM (14 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-mgr.c
r5647 r5650 995 995 } 996 996 997 static void998 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 else1012 {1013 ensureAtomExists( t, addr, port, flags, from );1014 }1015 }1016 1017 997 static int 1018 998 getMaxPeerCount( const tr_torrent * tor UNUSED ) … … 1120 1100 if( tr_blocklistHasAddress( manager->handle, addr ) ) 1121 1101 { 1122 tr_ inf( _( "Banned IP address \"%s\" tried to connect to us" ),1102 tr_dbg( "Banned IP address \"%s\" tried to connect to us", 1123 1103 inet_ntoa( *addr ) ); 1124 1104 tr_netClose( socket ); … … 1158 1138 1159 1139 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 ); 1161 1142 1162 1143 managerUnlock( manager ); -
trunk/libtransmission/peer-msgs.c
r5647 r5650 71 71 72 72 MAX_QUEUE_SIZE = (100), 73 MAX_OUTBUF_SIZE = (1024),74 73 75 74 /* (fast peers) max number of pieces we fast-allow to another peer */ … … 1601 1600 const int useSwift = isSwiftEnabled( msgs ); 1602 1601 const size_t swiftLeft = msgs->info->credit; 1603 size_t speedLeft;1604 size_t bufLeft;1602 int speedLeft; 1603 int bufLeft; 1605 1604 size_t ret; 1606 1605 … … 1610 1609 speedLeft = tr_rcBytesLeft( tor->upload ); 1611 1610 else 1612 speedLeft = ~0; 1613 1614 bufLeft = MAX_OUTBUF_SIZE - tr_peerIoWriteBytesWaiting( msgs->io ); 1611 speedLeft = INT_MAX; 1612 1613 /* this basically says the outbuf shouldn't have more than one block 1614 * queued up in it... blocksize, +13 for the size of the BT protocol's 1615 * block message overhead */ 1616 bufLeft = tor->blockSize + 13 - tr_peerIoWriteBytesWaiting( msgs->io ); 1615 1617 ret = MIN( speedLeft, bufLeft ); 1616 1618 if( useSwift) -
trunk/libtransmission/tracker.c
r5647 r5650 640 640 const int interval = t->scrapeIntervalSec + t->randOffset; 641 641 dbgmsg( t, "request succeeded. rescraping in %d seconds", interval ); 642 tr_ndbg( t->name, "request succeeded. rescraping in %d seconds", interval ); 642 643 t->scrapeAt = time( NULL ) + interval; 643 644 }
Note: See TracChangeset
for help on using the changeset viewer.