Changeset 7634


Ignore:
Timestamp:
Jan 7, 2009, 10:06:40 PM (12 years ago)
Author:
charles
Message:

(trunk libT) fix odd handshake bug reported by wereHamster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/handshake.c

    r7623 r7634  
    844844    for( i = 0; i < SHA_DIGEST_LENGTH; ++i )
    845845        obfuscatedTorrentHash[i] = req2[i] ^ req3[i];
    846     if( ( tor =
    847              tr_torrentFindFromObfuscatedHash( handshake->session,
    848                                                obfuscatedTorrentHash ) ) )
    849     {
     846    if(( tor = tr_torrentFindFromObfuscatedHash( handshake->session, obfuscatedTorrentHash )))
     847    {
     848        const tr_bool clientIsSeed = tr_torrentIsSeed( tor );
     849        const tr_bool peerIsSeed = tr_peerMgrPeerIsSeed( handshake->session->peerMgr,
     850                                                         tor->info.hash,
     851                                                         tr_peerIoGetAddress( handshake->io, NULL ) );
    850852        dbgmsg( handshake, "got INCOMING connection's encrypted handshake for torrent [%s]",
    851853                tor->info.name );
    852854        tr_peerIoSetTorrentHash( handshake->io, tor->info.hash );
    853         if( !tr_torrentAllowsPex( tor )
    854           && tr_peerMgrPeerIsSeed( handshake->session->peerMgr,
    855                                   tor->info.hash,
    856                                   tr_peerIoGetAddress( handshake->io, NULL ) ) )
     855
     856        if( clientIsSeed && peerIsSeed )
    857857        {
    858             dbgmsg( handshake, "a peer has tried to reconnect to us!" );
     858            dbgmsg( handshake, "another seed tried to reconnect to us!" );
    859859            return tr_handshakeDone( handshake, FALSE );
    860860        }
Note: See TracChangeset for help on using the changeset viewer.