mirror of
https://github.com/transmission/transmission
synced 2024-12-26 01:27:28 +00:00
* fix bug that incorrectly marked some incoming connections for termination
* strip unnecessary linefeeds out of some debug messages
This commit is contained in:
parent
24ec75acb1
commit
a9849660f6
2 changed files with 6 additions and 5 deletions
|
@ -277,7 +277,7 @@ parseHandshake( tr_handshake * handshake,
|
|||
uint8_t reserved[HANDSHAKE_FLAGS_LEN];
|
||||
uint8_t hash[SHA_DIGEST_LENGTH];
|
||||
|
||||
dbgmsg( handshake, "payload: need %d, got %d\n", (int)HANDSHAKE_SIZE, (int)EVBUFFER_LENGTH(inbuf) );
|
||||
dbgmsg( handshake, "payload: need %d, got %d", (int)HANDSHAKE_SIZE, (int)EVBUFFER_LENGTH(inbuf) );
|
||||
|
||||
if( EVBUFFER_LENGTH(inbuf) < HANDSHAKE_SIZE )
|
||||
return READ_MORE;
|
||||
|
@ -877,11 +877,11 @@ readIA( tr_handshake * handshake, struct evbuffer * inbuf )
|
|||
struct evbuffer * outbuf = evbuffer_new( );
|
||||
uint32_t crypto_select;
|
||||
|
||||
dbgmsg( handshake, "zbz reading IA... have %d, need %d", (int)EVBUFFER_LENGTH(inbuf), (int)needlen );
|
||||
dbgmsg( handshake, "reading IA... have %d, need %d", (int)EVBUFFER_LENGTH(inbuf), (int)needlen );
|
||||
if( EVBUFFER_LENGTH(inbuf) < needlen )
|
||||
return READ_MORE;
|
||||
|
||||
dbgmsg( handshake, "zbz reading IA..." );
|
||||
dbgmsg( handshake, "reading IA..." );
|
||||
/* parse the handshake ... */
|
||||
i = parseHandshake( handshake, inbuf );
|
||||
dbgmsg( handshake, "parseHandshake returned %d", i );
|
||||
|
@ -907,7 +907,7 @@ dbgmsg( handshake, "sending vc" );
|
|||
dbgmsg( handshake, "sending crypto_select" );
|
||||
/* send crypto_select */
|
||||
{
|
||||
dbgmsg( handshake, "handshake->crypto_provide is %d\n", (int)handshake->crypto_provide );
|
||||
dbgmsg( handshake, "handshake->crypto_provide is %d", (int)handshake->crypto_provide );
|
||||
if( handshake->crypto_provide & CRYPTO_PROVIDE_CRYPTO )
|
||||
crypto_select = CRYPTO_PROVIDE_CRYPTO;
|
||||
else if( handshake->allowUnencryptedPeers )
|
||||
|
|
|
@ -936,6 +936,7 @@ myHandshakeDoneCB( tr_handshake * handshake,
|
|||
peer->port = port;
|
||||
peer->io = io;
|
||||
peer->msgs = tr_peerMsgsNew( t->tor, peer, msgsCallbackFunc, t, &peer->msgsTag );
|
||||
atom->time = time( NULL );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1516,7 +1517,7 @@ getWeakConnections( Torrent * t, int * setmeSize )
|
|||
isWeak = FALSE;
|
||||
else if( peerIsSeed && clientIsSeed )
|
||||
isWeak = t->tor->pexDisabled || (now-atom->time>=30);
|
||||
else if( ( now - atom->time ) < LAISSEZ_FAIRE_PERIOD_SECS )
|
||||
else if( !atom->time || ( ( now - atom->time ) < LAISSEZ_FAIRE_PERIOD_SECS ) )
|
||||
isWeak = FALSE;
|
||||
else
|
||||
isWeak = ( now - peer->pieceDataActivityDate ) > 180;
|
||||
|
|
Loading…
Reference in a new issue