Changeset 3433


Ignore:
Timestamp:
Oct 16, 2007, 3:14:07 AM (15 years ago)
Author:
charles
Message:

more tweaks

File:
1 edited

Legend:

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

    r3432 r3433  
    848848ensureAtomExists( Torrent * t, const struct in_addr * addr, uint16_t port, uint8_t flags, uint8_t from )
    849849{
    850     struct peer_atom * a = getExistingAtom( t, addr );
    851 
    852     if( a == NULL )
    853     {
     850    if( getExistingAtom( t, addr ) == NULL )
     851    {
     852        struct peer_atom * a;
    854853        a = tr_new0( struct peer_atom, 1 );
    855854        a->addr = *addr;
    856855        a->port = port;
    857856        a->flags = flags;
     857        a->from = from;
    858858        tordbg( t, "got a new atom: %s", tr_peerIoAddrStr(&a->addr,a->port) );
    859859        tr_ptrArrayInsertSorted( t->pool, a, comparePeerAtoms );
    860860    }
    861 
    862     a->from = from;
    863861}
    864862
     
    873871    int ok = isConnected;
    874872    uint16_t port;
    875     const struct in_addr * in_addr;
     873    const struct in_addr * addr;
    876874    tr_peerMgr * manager = (tr_peerMgr*) vmanager;
    877875    Torrent * t;
     
    900898        torrentLock( t );
    901899
    902     in_addr = tr_peerIoGetAddress( io, &port );
     900    addr = tr_peerIoGetAddress( io, &port );
    903901
    904902    if( !ok || !t || !t->isRunning )
    905903    {
    906904        tr_peerIoFree( io );
    907 
    908         if( t )
    909             ++getExistingAtom( t, in_addr )->numFails;
    910905    }
    911906    else /* looking good */
    912907    {
    913         uint16_t port;
    914         const struct in_addr * addr = tr_peerIoGetAddress( io,  &port );
    915908        struct peer_atom * atom;
    916909        ensureAtomExists( t, addr, port, 0, TR_PEER_FROM_INCOMING );
Note: See TracChangeset for help on using the changeset viewer.