1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-03 02:05:19 +00:00

attempt to add random-port functionality to the rpc code

This commit is contained in:
Mitchell Livingston 2009-04-03 03:40:37 +00:00
parent faa5d70c6f
commit a621b7eedb
2 changed files with 4 additions and 1 deletions

View file

@ -369,6 +369,7 @@
"peer-limit-per-torrent" | number maximum global number of peers
"pex-enabled" | 'boolean' true means allow pex in public torrents
"peer-port" | number port number
"peer-port-random-enabled" | 'boolean' true means pick a random peer port on launch
"port-forwarding-enabled" | 'boolean' true means enabled
"rpc-version" | number the current RPC API version
"rpc-version-minimum" | number the minimum RPC API version supported

View file

@ -970,7 +970,9 @@ sessionSet( tr_session * session,
tr_sessionSetPeerLimitPerTorrent( session, i );
if( tr_bencDictFindBool( args_in, TR_PREFS_KEY_PEX_ENABLED, &boolVal ) )
tr_sessionSetPexEnabled( session, boolVal );
if( tr_bencDictFindInt( args_in, TR_PREFS_KEY_PEER_PORT, &i ) )
if( tr_bencDictFindBool( args_in, TR_PREFS_KEY_PEER_PORT_RANDOM_ENABLED, &boolVal ) && boolVal )
tr_sessionSetPeerPortRandom( session );
else if( tr_bencDictFindInt( args_in, TR_PREFS_KEY_PEER_PORT, &i ) )
tr_sessionSetPeerPort( session, i );
if( tr_bencDictFindBool( args_in, TR_PREFS_KEY_PORT_FORWARDING, &boolVal ) )
tr_sessionSetPortForwardingEnabled( session, boolVal );