Changeset 3433
- Timestamp:
- Oct 16, 2007, 3:14:07 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-mgr.c
r3432 r3433 848 848 ensureAtomExists( Torrent * t, const struct in_addr * addr, uint16_t port, uint8_t flags, uint8_t from ) 849 849 { 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; 854 853 a = tr_new0( struct peer_atom, 1 ); 855 854 a->addr = *addr; 856 855 a->port = port; 857 856 a->flags = flags; 857 a->from = from; 858 858 tordbg( t, "got a new atom: %s", tr_peerIoAddrStr(&a->addr,a->port) ); 859 859 tr_ptrArrayInsertSorted( t->pool, a, comparePeerAtoms ); 860 860 } 861 862 a->from = from;863 861 } 864 862 … … 873 871 int ok = isConnected; 874 872 uint16_t port; 875 const struct in_addr * in_addr;873 const struct in_addr * addr; 876 874 tr_peerMgr * manager = (tr_peerMgr*) vmanager; 877 875 Torrent * t; … … 900 898 torrentLock( t ); 901 899 902 in_addr = tr_peerIoGetAddress( io, &port );900 addr = tr_peerIoGetAddress( io, &port ); 903 901 904 902 if( !ok || !t || !t->isRunning ) 905 903 { 906 904 tr_peerIoFree( io ); 907 908 if( t )909 ++getExistingAtom( t, in_addr )->numFails;910 905 } 911 906 else /* looking good */ 912 907 { 913 uint16_t port;914 const struct in_addr * addr = tr_peerIoGetAddress( io, &port );915 908 struct peer_atom * atom; 916 909 ensureAtomExists( t, addr, port, 0, TR_PEER_FROM_INCOMING );
Note: See TracChangeset
for help on using the changeset viewer.