1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 09:13:06 +00:00

more connection management changes

This commit is contained in:
Charles Kerr 2008-08-16 16:00:49 +00:00
parent 839cfe9155
commit 93898401fb
3 changed files with 8 additions and 8 deletions

View file

@ -785,7 +785,7 @@ readCryptoProvide( tr_handshake * handshake, struct evbuffer * inbuf )
obfuscatedTorrentHash[i] = req2[i] ^ req3[i];
if(( tor = tr_torrentFindFromObfuscatedHash( handshake->handle, obfuscatedTorrentHash )))
{
dbgmsg( handshake, "found the torrent; it's [%s]", tor->info.name );
dbgmsg( handshake, "got INCOMING connection's encrypted handshake for torrent [%s]", tor->info.name );
tr_peerIoSetTorrentHash( handshake->io, tor->info.hash );
if( !tr_torrentAllowsPex( tor ) &&
tr_peerMgrPeerIsSeed( handshake->handle->peerMgr,

View file

@ -123,7 +123,7 @@ createSocket( int type, int priority )
fd = makeSocketNonBlocking( fd );
if( fd >= 0 ) {
const int buffsize = 1500*2; /* 2x MTU for most ethernet/wireless */
const int buffsize = 1500*3; /* 3x MTU for most ethernet/wireless */
setsockopt( fd, SOL_SOCKET, SO_SNDBUF, &buffsize, sizeof( buffsize ) );
}

View file

@ -1009,7 +1009,6 @@ myHandshakeDoneCB( tr_handshake * handshake,
peer->io = io;
peer->msgs = tr_peerMsgsNew( t->tor, peer, peerCallbackFunc, t, &peer->msgsTag );
atom->time = time( NULL );
atom->numFails = 0;
}
}
}
@ -1764,10 +1763,11 @@ getReconnectIntervalSecs( const struct peer_atom * atom )
switch( atom->numFails )
{
case 0: sec = 0; break;
case 1: sec = 30; break;
case 2: sec = 15*60; break;
case 3: sec = 30*60; break;
case 4: sec = 60*60; break;
case 1: sec = 5; break;
case 2: sec = 2*60; break;
case 3: sec = 15*60; break;
case 4: sec = 30*60; break;
case 5: sec = 60*60; break;
default: sec = 120*60; break;
}
@ -1871,7 +1871,7 @@ reconnectPulse( void * vtorrent )
(int)MAX_RECONNECTIONS_PER_PULSE );
/* disconnect some peers.
if we got transferred piece data, then they might be good peers,
if we transferred piece data, then they might be good peers,
so reset their `numFails' weight to zero. otherwise we connected
to them fruitlessly, so mark it as another fail */
for( i=0; i<nBad; ++i ) {