1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 16:52:39 +00:00

separate getting/setting # connections and # unchoked

This commit is contained in:
Mitchell Livingston 2007-12-22 04:00:19 +00:00
parent 7542573044
commit 3449e2d15c
3 changed files with 24 additions and 21 deletions

View file

@ -1206,25 +1206,27 @@ tr_torrentSetFileDLs ( tr_torrent * tor,
***/ ***/
void void
tr_torrentSetPeerLimits( tr_torrent * tor, tr_torrentSetPeerLimit( tr_torrent * tor,
uint16_t maxConnectedPeers, uint16_t maxConnectedPeers )
uint8_t maxUnchokedPeers )
{ {
if( maxConnectedPeers ) tor->maxConnectedPeers = maxConnectedPeers;
tor->maxConnectedPeers = maxConnectedPeers;
if( maxUnchokedPeers )
tor->maxUnchokedPeers = maxUnchokedPeers;
} }
void void
tr_torrentGetPeerLimits( const tr_torrent * tor, tr_torrentSetPeerUnchokedLimit( tr_torrent * tor,
uint16_t * maxConnectedPeers, uint8_t maxUnchokedPeers )
uint8_t * maxUnchokedPeers )
{ {
if( maxConnectedPeers ) tor->maxUnchokedPeers = maxUnchokedPeers;
*maxConnectedPeers = tor->maxConnectedPeers; }
if( maxUnchokedPeers )
*maxUnchokedPeers = tor->maxUnchokedPeers; uint16_t tr_torrentGetPeerLimit( const tr_torrent * tor )
{
return tor->maxConnectedPeers;
}
uint8_t tr_torrentGetPeerUnchokedLimit( const tr_torrent * tor )
{
return tor->maxUnchokedPeers;
} }
/*** /***

View file

@ -278,14 +278,15 @@ void tr_getGlobalSpeedLimit( tr_handle * handle,
*** Peer Limits *** Peer Limits
**/ **/
/* pass `0' to a field here to leave it unchanged */ void tr_torrentSetPeerLimit( tr_torrent * tor,
void tr_torrentSetPeerLimits( tr_torrent * tor, uint16_t maxConnectedPeers);
uint16_t maxConnectedPeers,
void tr_torrentSetPeerUnchokedLimit( tr_torrent * tor,
uint8_t maxUnchokedPeers ); uint8_t maxUnchokedPeers );
void tr_torrentGetPeerLimits( const tr_torrent * tor, uint16_t tr_torrentGetPeerLimit( const tr_torrent * tor );
uint16_t * maxConnectedPeers,
uint8_t * maxUnchokedPeers ); uint8_t tr_torrentGetPeerUnchokedLimit( const tr_torrent * tor );
void tr_setGlobalPeerLimit( tr_handle * handle, void tr_setGlobalPeerLimit( tr_handle * handle,
uint16_t maxGlobalPeers ); uint16_t maxGlobalPeers );

View file

@ -1466,7 +1466,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
fIncompleteFolder = [[fIncompleteFolder stringByExpandingTildeInPath] retain]; fIncompleteFolder = [[fIncompleteFolder stringByExpandingTildeInPath] retain];
} }
//set libT settings //set libtransmission settings for initialization
tr_ctor * ctor = tr_ctorNew(fLib); tr_ctor * ctor = tr_ctorNew(fLib);
tr_ctorSetPaused(ctor, TR_FORCE, YES); tr_ctorSetPaused(ctor, TR_FORCE, YES);