Changeset 3359


Ignore:
Timestamp:
Oct 11, 2007, 12:09:58 AM (15 years ago)
Author:
charles
Message:

(1) maybe fix the "peer->msgs != NULL" bug reported by Dhruvk and John_Clay (2) remove dead code

Location:
trunk/libtransmission
Files:
5 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r3349 r3359  
    910910        ensureAtomExists( t, addr, port, 0, TR_PEER_FROM_INCOMING );
    911911        atom = getExistingAtom( t, addr );
    912         tr_peer * peer = getPeer( t, addr );
     912
    913913        if( atom->myflags & MYFLAG_BANNED )
    914914        {
    915915            tordbg( t, "banned peer %s tried to reconnect", tr_peerIoAddrStr(&atom->addr,atom->port) );
    916916            tr_peerIoFree( io );
    917             peer->doPurge = 1;
    918         }
    919         else if( peer->msgs != NULL ) /* we already have this peer */
    920         {
    921             tr_peerIoFree( io );
    922917        }
    923918        else
    924919        {
    925             tr_free( peer->client );
    926             peer->client = peer_id ? tr_clientForId( peer_id ) : NULL;
    927             peer->port = port;
    928             peer->io = io;
    929             peer->msgs = tr_peerMsgsNew( t->tor, peer, msgsCallbackFunc, t, &peer->msgsTag );
    930             atom->time = time( NULL );
     920            tr_peer * peer = getExistingPeer( t, addr );
     921
     922            if( peer != NULL ) /* we already have this peer */
     923            {
     924                tr_peerIoFree( io );
     925            }
     926            else
     927            {
     928                peer = getPeer( t, addr );
     929                tr_free( peer->client );
     930                peer->client = peer_id ? tr_clientForId( peer_id ) : NULL;
     931                peer->port = port;
     932                peer->io = io;
     933                peer->msgs = tr_peerMsgsNew( t->tor, peer, msgsCallbackFunc, t, &peer->msgsTag );
     934                atom->time = time( NULL );
     935            }
    931936        }
    932937    }
Note: See TracChangeset for help on using the changeset viewer.