Changeset 11194


Ignore:
Timestamp:
Sep 3, 2010, 4:30:43 AM (11 years ago)
Author:
charles
Message:

(trunk) revert the RPC behavior of rateUpload, rateDownload, rateToClient, and rateToPeer as discussed with Longinus00

Location:
trunk
Files:
5 edited

Legend:

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

    r11190 r11194  
    183183   pieceSize                   | number                      | tr_info
    184184   priorities                  | array (see below)           | n/a
    185    rateDownload (KBps)         | double                      | tr_stat
    186    rateUpload (KBps)           | double                      | tr_stat
     185   rateDownload (B/s)          | number                      | tr_stat
     186   rateUpload (B/s)            | number                      | tr_stat
    187187   recheckProgress             | double                      | tr_stat
    188188   seedIdleLimit               | number                      | tr_torrent
     
    236236                      | port                    | number     | tr_peer_stat
    237237                      | progress                | double     | tr_peer_stat
    238                       | rateToClient (KBps)     | double     | tr_peer_stat
    239                       | rateToPeer (KBps)       | double     | tr_peer_stat
     238                      | rateToClient (B/s)      | number     | tr_peer_stat
     239                      | rateToPeer (B/s)        | number     | tr_peer_stat
    240240   -------------------+--------------------------------------+
    241241   peersFrom          | an object containing:                |
     
    625625         |         | yes       | torrent-set    | new arg "seedIdleLimit"
    626626         |         | yes       | torrent-set    | new arg "seedIdleMode"
    627          |         |        NO | torrent-get    | units for "rateDownload" changed from B to KB
    628          |         |        NO | torrent-get    | units for "rateUpload" changed from B to KB
  • trunk/libtransmission/announcer.c

    r11190 r11194  
    19941994            tr_strlcpy( st->host, tracker->host->name, sizeof( st->host ) );
    19951995            tr_strlcpy( st->announce, tracker->announce, sizeof( st->announce ) );
    1996             tr_strlcpy( st->scrape, tracker->scrape, sizeof( st->scrape ) );
    19971996            st->tier = i;
    19981997            st->isBackup = tracker != tier->currentTracker;
    19991998            st->lastScrapeStartTime = tier->lastScrapeStartTime;
     1999            if( tracker->scrape )
     2000                tr_strlcpy( st->scrape, tracker->scrape, sizeof( st->scrape ) );
     2001            else
     2002                st->scrape[0] = '\0';
    20002003
    20012004            st->seederCount = tracker->seederCount;
  • trunk/libtransmission/rpcimpl.c

    r11190 r11194  
    444444        tr_bencDictAddInt ( d, "port", peer->port );
    445445        tr_bencDictAddReal( d, "progress", peer->progress );
    446         tr_bencDictAddReal( d, "rateToClient", peer->rateToClient_KBps );
    447         tr_bencDictAddReal( d, "rateToPeer", peer->rateToPeer_KBps );
     446        tr_bencDictAddInt ( d, "rateToClient", toSpeedBytes( peer->rateToClient_KBps ) );
     447        tr_bencDictAddInt ( d, "rateToPeer", toSpeedBytes( peer->rateToPeer_KBps ) );
    448448    }
    449449
     
    571571    }
    572572    else if( tr_streq( key, keylen, "rateDownload" ) )
    573         tr_bencDictAddReal( d, key, st->pieceDownloadSpeed_KBps );
     573        tr_bencDictAddInt( d, key, toSpeedBytes( st->pieceDownloadSpeed_KBps ) );
    574574    else if( tr_streq( key, keylen, "rateUpload" ) )
    575         tr_bencDictAddReal( d, key, st->pieceUploadSpeed_KBps );
     575        tr_bencDictAddInt( d, key, toSpeedBytes( st->pieceUploadSpeed_KBps ) );
    576576    else if( tr_streq( key, keylen, "recheckProgress" ) )
    577577        tr_bencDictAddReal( d, key, st->recheckProgress );
  • trunk/qt/torrent.cc

    r11092 r11194  
    5656{
    5757    { ID, "id", QVariant::Int, INFO, },
    58     { UPLOAD_SPEED, "rateUpload", QVariant::Double, STAT } /* KBps */,
    59     { DOWNLOAD_SPEED, "rateDownload", QVariant::Double, STAT }, /* KBps */
     58    { UPLOAD_SPEED, "rateUpload", QVariant::ULongLong, STAT } /* Bps */,
     59    { DOWNLOAD_SPEED, "rateDownload", QVariant::ULongLong, STAT }, /* Bps */
    6060    { DOWNLOAD_DIR, "downloadDir", QVariant::String, STAT },
    6161    { ACTIVITY, "status", QVariant::Int, STAT },
     
    663663            if( tr_bencDictFindReal( child, "progress", &d ) )
    664664                peer.progress = d;
    665             if( tr_bencDictFindReal( child, "rateToClient", &d ) )
    666                 peer.rateToClient = Speed::fromKBps( d );
    667             if( tr_bencDictFindReal( child, "rateToPeer", &d ) )
    668                 peer.rateToPeer = Speed::fromKBps( d );
     665            if( tr_bencDictFindInt( child, "rateToClient", &i ) )
     666                peer.rateToClient = Speed::fromBps( i );
     667            if( tr_bencDictFindInt( child, "rateToPeer", &i ) )
     668                peer.rateToPeer = Speed::fromBps( i );
    669669            peerList << peer;
    670670        }
  • trunk/qt/torrent.h

    r11092 r11194  
    284284        int connectedPeers( ) const { return getInt( PEERS_CONNECTED ); }
    285285        int connectedPeersAndWebseeds( ) const { return connectedPeers( ) + getInt( WEBSEEDS_SENDING_TO_US ); }
    286         Speed downloadSpeed( ) const { return Speed::fromKBps( getDouble( DOWNLOAD_SPEED ) ); }
    287         Speed uploadSpeed( ) const { return Speed::fromKBps( getDouble( UPLOAD_SPEED ) ); }
     286        Speed downloadSpeed( ) const { return Speed::fromBps( getSize( DOWNLOAD_SPEED ) ); }
     287        Speed uploadSpeed( ) const { return Speed::fromBps( getSize( UPLOAD_SPEED ) ); }
    288288        double getVerifyProgress( ) const { return getDouble( PERCENT_VERIFIED ); }
    289289        bool hasFileSubstring( const QString& substr ) const;
Note: See TracChangeset for help on using the changeset viewer.