Changeset 8105
- Timestamp:
- Mar 29, 2009, 6:45:35 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/rpc-spec.txt
r8097 r8105 108 108 "priority-low" | array indices of low-priority file(s) 109 109 "priority-normal" | array indices of normal-priority file(s) 110 "seedRatioLimit" | 'double' session seeding ratio 111 "seedRatioLimited" | 'boolean' true if "seedRatioLimit" is honored 110 112 "uploadLimit" | number maximum upload speed (in K/s) 111 113 "uploadLimited" | 'boolean' true if "uploadLimit" is honored … … 185 187 scrapeURL | string | tr_stat 186 188 seeders | number | tr_stat 189 seedRatioLimit | 'double' | tr_torrent 190 seedRatioMode | number | tr_ratiolimit 187 191 sizeWhenDone | number | tr_stat 188 192 startDate | number | tr_stat … … 439 443 | | yes | torrent-set | new arg "downloadLimited" 440 444 | | yes | torrent-set | new arg "uploadLimited" 441 | | yes | torrent-set | new arg "honorsSessionLImits" 445 | | yes | torrent-set | new arg "honorsSessionLimits" 446 | | yes | session-get | new arg "seedRatioLimit" 447 | | yes | session-get | new arg "seedRatioLimited" 442 448 | | yes | session-get | new arg "alt-speed-enabled" 443 449 | | yes | session-get | new arg "alt-speed-time-enabled" … … 449 455 | | yes | session-get | new arg "blocklist-size" 450 456 | | yes | session-get | new arg "peer-limit-per-torrent" 457 | | yes | torrent-get | new arg "seedRatioLimit" 458 | | yes | torrent-get | new arg "seedRatioMode" 451 459 | | yes | torrent-get | new ids option "recently-active" 452 460 | | yes | | new method "torrent-reannounce" -
trunk/libtransmission/bencode.c
r8071 r8105 447 447 448 448 tr_bool 449 tr_bencDictFindBool( tr_benc * dict, const char * key, tr_bool * setme ) 450 { 451 int64_t i = 0; 452 const tr_bool found = tr_bencDictFindInt( dict, key, &i ); 453 *setme = i!=0; 454 return found; 455 } 456 457 tr_bool 449 458 tr_bencDictFindDouble( tr_benc * dict, const char * key, double * setme ) 450 459 { … … 698 707 699 708 return child; 709 } 710 711 tr_benc* 712 tr_bencDictAddBool( tr_benc * dict, const char * key, tr_bool val ) 713 { 714 assert( tr_isBool( val ) ); 715 716 return tr_bencDictAddInt( dict, key, val ); 700 717 } 701 718 -
trunk/libtransmission/bencode.h
r8071 r8105 131 131 tr_benc * tr_bencDictAddInt( tr_benc *, const char * key, int64_t ); 132 132 133 tr_benc * tr_bencDictAddBool( tr_benc *, const char * key, tr_bool ); 134 133 135 tr_benc * tr_bencDictAddStr( tr_benc *, const char * key, const char * ); 134 136 … … 149 151 150 152 tr_bool tr_bencDictFindDouble( tr_benc *, const char * key, double * setme ); 153 154 tr_bool tr_bencDictFindBool( tr_benc *, const char * key, tr_bool * setme ); 151 155 152 156 tr_bool tr_bencDictFindStr( tr_benc *, const char * key, const char ** setme ); -
trunk/libtransmission/rpcimpl.c
r8097 r8105 501 501 else if( !strcmp( key, "seeders" ) ) 502 502 tr_bencDictAddInt( d, key, st->seeders ); 503 else if( !strcmp( key, "seedRatioLimit" ) ) 504 tr_bencDictAddDouble( d, key, tr_torrentGetRatioLimit( tor ) ); 505 else if( !strcmp( key, "seedRatioMode" ) ) 506 tr_bencDictAddInt( d, key, tr_torrentGetRatioMode( tor ) ); 503 507 else if( !strcmp( key, "sizeWhenDone" ) ) 504 508 tr_bencDictAddInt( d, key, st->sizeWhenDone ); … … 700 704 if( tr_bencDictFindInt( args_in, "ratio-limit-mode", &tmp ) ) 701 705 tr_torrentSetRatioMode( tor, tmp ); 706 if( tr_bencDictFindDouble( args_in, "seedRatioLimit", &d ) ) 707 tr_torrentSetRatioLimit( tor, d ); 708 if( tr_bencDictFindInt( args_in, "seedRatioMode", &tmp ) ) 709 tr_torrentSetRatioMode( tor, tmp ); 702 710 notify( session, TR_RPC_TORRENT_CHANGED, tor ); 703 711 } … … 855 863 struct tr_rpc_idle_data * idle_data ) 856 864 { 865 tr_bool b; 857 866 int64_t i; 858 867 double d; … … 887 896 if( tr_bencDictFindInt( args_in, TR_PREFS_KEY_PORT_FORWARDING, &i ) ) 888 897 tr_sessionSetPortForwardingEnabled( session, i ); 898 if( tr_bencDictFindDouble( args_in, "seedRatioLimit", &d ) ) 899 tr_sessionSetRatioLimit( session, d ); 900 if( tr_bencDictFindBool( args_in, "seedRatioLimited", &b ) ) 901 tr_sessionSetRatioLimited( session, b ); 889 902 if( tr_bencDictFindInt( args_in, "speed-limit-down", &i ) ) 890 903 tr_sessionSetSpeedLimit( session, TR_DOWN, i ); … … 987 1000 tr_bencDictAddInt( d, "rpc-version", 4 ); 988 1001 tr_bencDictAddInt( d, "rpc-version-minimum", 1 ); 1002 tr_bencDictAddDouble( d, "seedRatioLimit", tr_sessionGetRatioLimit( s ) ); 1003 tr_bencDictAddBool( d, "seedRatioLimited", tr_sessionIsRatioLimited( s ) ); 989 1004 tr_bencDictAddInt( d, "speed-limit-up", tr_sessionGetSpeedLimit( s, TR_UP ) ); 990 1005 tr_bencDictAddInt( d, "speed-limit-up-enabled", tr_sessionIsSpeedLimited( s, TR_UP ) );
Note: See TracChangeset
for help on using the changeset viewer.