(trunk libT) #3159 "better choosing of which peers to initiate new connections with" -- fix new bug in r10500 that was reported by Sharpshot in #3160

This commit is contained in:
Charles Kerr 2010-04-21 04:44:35 +00:00
parent ceba9e6722
commit 25103d5198
2 changed files with 4 additions and 3 deletions

View File

@ -1143,7 +1143,8 @@ tr_handshakeDone( tr_handshake * handshake,
void
tr_handshakeAbort( tr_handshake * handshake )
{
tr_handshakeDone( handshake, FALSE );
if( handshake != NULL )
tr_handshakeDone( handshake, FALSE );
}
static void

View File

@ -1069,7 +1069,7 @@ parseUtPex( tr_peermsgs * msgs, int msglen, struct evbuffer * inbuf )
for( i=0; i<n; ++i )
{
int seedProbability = -1;
if( added_f_len < n ) seedProbability = ( added_f[i] & ADDED_F_SEED_FLAG ) ? 100 : 0;
if( i < added_f_len ) seedProbability = ( added_f[i] & ADDED_F_SEED_FLAG ) ? 100 : 0;
tr_peerMgrAddPex( tor, TR_PEER_FROM_PEX, pex+i, seedProbability );
}
@ -1090,7 +1090,7 @@ parseUtPex( tr_peermsgs * msgs, int msglen, struct evbuffer * inbuf )
for( i=0; i<n; ++i )
{
int seedProbability = -1;
if( added_f_len < n ) seedProbability = ( added_f[i] & ADDED_F_SEED_FLAG ) ? 100 : 0;
if( i < added_f_len ) seedProbability = ( added_f[i] & ADDED_F_SEED_FLAG ) ? 100 : 0;
tr_peerMgrAddPex( tor, TR_PEER_FROM_PEX, pex+i, seedProbability );
}