Changeset 3411
- Timestamp:
- Oct 14, 2007, 5:21:24 PM (15 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/internal.h
r3284 r3411 62 62 void tr_torrentUnlock ( const tr_torrent * ); 63 63 64 int tr_torrentIsPexEnabled( const tr_torrent * ); 65 64 66 void tr_torrentChangeMyPort ( tr_torrent * ); 65 67 -
trunk/libtransmission/peer-mgr.c
r3395 r3411 1506 1506 const int clientIsSeed = tr_cpGetStatus( tor->completion ) != TR_CP_INCOMPLETE; 1507 1507 const int peerIsSeed = atom->flags & ADDED_F_SEED_FLAG; 1508 if( peerIsSeed && clientIsSeed && ( tor->pexDisabled|| (now-atom->time>=30) ) ) {1508 if( peerIsSeed && clientIsSeed && ( !tr_torrentIsPexEnabled(tor) || (now-atom->time>=30) ) ) { 1509 1509 tordbg( t, "purging peer %s because we're both seeds", tr_peerIoAddrStr(&atom->addr,atom->port) ); 1510 1510 return TRUE; … … 1603 1603 1604 1604 /* if we used this peer recently, give someone else a turn */ 1605 if( ( now - atom->time ) < 60 ) {1605 if( ( now - atom->time ) < 180 ) { 1606 1606 tordbg( t, "RECONNECT peer %d (%s) is in its grace period..", 1607 1607 i, tr_peerIoAddrStr(&atom->addr,atom->port) ); -
trunk/libtransmission/peer-msgs.c
r3409 r3411 691 691 692 692 /* decide if we want to advertise pex support */ 693 if( msgs->torrent->pexDisabled)693 if( !tr_torrentIsPexEnabled( msgs->torrent ) ) 694 694 pex = 0; 695 695 else if( msgs->peerSentLtepHandshake ) … … 785 785 uint8_t * tmp; 786 786 787 if( msgs->torrent->pexDisabled) /* no sharing! */787 if( !tr_torrentIsPexEnabled( msgs->torrent ) ) /* no sharing! */ 788 788 return; 789 789 … … 1512 1512 sendPex( tr_peermsgs * msgs ) 1513 1513 { 1514 if( msgs->peerSupportsPex && !msgs->torrent->pexDisabled)1514 if( msgs->peerSupportsPex && tr_torrentIsPexEnabled( msgs->torrent ) ) 1515 1515 { 1516 1516 int i; … … 1634 1634 m->clientAllowedPieces = NULL; 1635 1635 setme = tr_publisherSubscribe( m->publisher, func, userData ); 1636 tr_peerIoSetTimeoutSecs( m->io, 150 ); /* error if we don't read or write for 2.5 minutes */1637 1636 1638 1637 if ( tr_peerIoSupportsFEXT( m->io ) ) … … 1651 1650 } 1652 1651 1652 tr_peerIoSetTimeoutSecs( m->io, 150 ); /* error if we don't read or write for 2.5 minutes */ 1653 1653 tr_peerIoSetIOFuncs( m->io, canRead, didWrite, gotError, m ); 1654 1654 tr_peerIoSetIOMode( m->io, EV_READ|EV_WRITE, 0 ); -
trunk/libtransmission/torrent.c
r3407 r3411 645 645 } 646 646 647 int 648 tr_torrentIsPexEnabled( const tr_torrent * tor ) 649 { 650 if( tor->info.flags & TR_FLAG_PRIVATE ) 651 return FALSE; 652 653 if( tor->pexDisabled ) 654 return FALSE; 655 656 return TRUE; 657 } 647 658 648 659 void
Note: See TracChangeset
for help on using the changeset viewer.