Changeset 6245


Ignore:
Timestamp:
Jun 22, 2008, 1:44:50 PM (14 years ago)
Author:
charles
Message:

(RPC) make all the speed units consistent.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/rpc-spec.txt

    r6237 r6245  
    8888   "priority-low"             | array      indices of low-priority file(s)
    8989   "priority-normal"          | array      indices of normal-priority file(s)
    90    "speed-limit-down"         | number     maximum download speed (in KiB/s)
     90   "speed-limit-down"         | number     maximum download speed (in K/s)
    9191   "speed-limit-down-enabled" | 'boolean'  true if the download speed is limited
    92    "speed-limit-up"           | number     maximum upload speed (in KiB/s)
     92   "speed-limit-up"           | number     maximum upload speed (in K/s)
    9393   "speed-limit-up-enabled"   | 'boolean'  true if the upload speed is limited
    9494
     
    126126                      | number   | recheckProgress        | tr_stat
    127127                      | number   | status                 | tr_stat
    128                       | number   | swarmSpeed             | tr_stat
     128                      | number   | swarmSpeed (K/s)       | tr_stat
    129129                      | 'double' | uploadRatio            | tr_stat
    130130                      | number   | webseedsSendingToUs    | tr_stat
     
    303303   "port"                     | number     port number
    304304   "port-forwarding-enabled"  | 'boolean'  true means enabled
    305    "speed-limit-down"         | number     max global download speed (in KiB/s)
     305   "speed-limit-down"         | number     max global download speed (in K/s)
    306306   "speed-limit-down-enabled" | 'boolean'  true means enabled
    307    "speed-limit-up"           | number     max global upload speed (in KiB/s)
     307   "speed-limit-up"           | number     max global upload speed (in K/s)
    308308   "speed-limit-up-enabled"   | 'boolean'  true means enabled
    309309
  • trunk/libtransmission/rpc.c

    r6237 r6245  
    217217        tr_bencDictAddDouble( d, "recheckProgress", st->recheckProgress );
    218218        tr_bencDictAddInt( d, "status", st->status );
    219         tr_bencDictAddDouble( d, "swarmSpeed", st->swarmSpeed );
    220         tr_bencDictAddDouble( d, "ratio", st->ratio );
     219        tr_bencDictAddInt( d, "swarmSpeed", (int)(st->swarmSpeed*1024) );
    221220        tr_bencDictAddInt( d, "webseedsSendingToUs", st->webseedsSendingToUs );
    222221    }
     
    561560                          tr_sessionIsPortForwardingEnabled( h ) );
    562561    tr_bencDictAddInt( d, "speed-limit-up",
    563                           tr_sessionGetSpeedLimit( h, TR_UP ) );
     562                          tr_sessionGetSpeedLimit( h, TR_UP ) * 1024 );
    564563    tr_bencDictAddInt( d, "speed-limit-up-enabled",
    565564                          tr_sessionIsSpeedLimitEnabled( h, TR_UP ) );
    566565    tr_bencDictAddInt( d, "speed-limit-down",
    567                           tr_sessionGetSpeedLimit( h, TR_DOWN ) );
     566                          tr_sessionGetSpeedLimit( h, TR_DOWN ) * 1024 );
    568567    tr_bencDictAddInt( d, "speed-limit-down-enabled",
    569568                          tr_sessionIsSpeedLimitEnabled( h, TR_DOWN ) );
Note: See TracChangeset for help on using the changeset viewer.