Changeset 8709


Ignore:
Timestamp:
Jun 16, 2009, 7:31:17 PM (13 years ago)
Author:
charles
Message:

(trunk libT) revert most of r8693 as a quick fix for a possible alignment issue on a NAS

Location:
trunk/libtransmission
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bandwidth.h

    r8693 r8709  
    1717#ifndef TR_BANDWIDTH_H
    1818#define TR_BANDWIDTH_H
    19 
    20 #include <assert.h>
    2119
    2220#include "transmission.h"
     
    155153 */
    156154static TR_INLINE void tr_bandwidthSetDesiredSpeed( tr_bandwidth        * bandwidth,
    157                                                    tr_direction          dir,
    158                                                    double                desiredSpeed )
     155                                                tr_direction          dir,
     156                                                double                desiredSpeed )
    159157{
    160158    bandwidth->band[dir].desiredSpeed = desiredSpeed;
     
    241239 * in that particular case we want to ignore the global speed limit...
    242240 */
    243 static TR_INLINE void
    244 tr_bandwidthHonorParentLimits( tr_bandwidth  * bandwidth,
    245                                tr_direction    direction,
    246                                tr_bool         isEnabled )
     241static TR_INLINE void tr_bandwidthHonorParentLimits ( tr_bandwidth        * bandwidth,
     242                                                      tr_direction          direction,
     243                                                      tr_bool               isEnabled )
    247244{
    248245    assert( tr_isBandwidth( bandwidth ) );
     
    252249}
    253250
    254 static TR_INLINE tr_bool
    255 tr_bandwidthAreParentLimitsHonored( const tr_bandwidth  * bandwidth,
    256                                     tr_direction          direction )
     251static TR_INLINE tr_bool tr_bandwidthAreParentLimitsHonored( tr_bandwidth  * bandwidth,
     252                                                             tr_direction    direction )
    257253{
    258254    assert( tr_isBandwidth( bandwidth ) );
  • trunk/libtransmission/peer-mgr.c

    r8693 r8709  
    13151315                peer->io = tr_handshakeStealIO( handshake ); /* this steals its refcount too, which is
    13161316                                                                balanced by our unref in peerDestructor()  */
    1317                 tr_peerIoSetParent( peer->io, &t->tor->bandwidth );
     1317                tr_peerIoSetParent( peer->io, t->tor->bandwidth );
    13181318                tr_peerMsgsNew( t->tor, peer, peerCallbackFunc, t, &peer->msgsTag );
    13191319
  • trunk/libtransmission/torrent.c

    r8693 r8709  
    115115    assert( tr_isDirection( dir ) );
    116116
    117     tr_bandwidthSetDesiredSpeed( &tor->bandwidth, dir, KiB_sec );
     117    tr_bandwidthSetDesiredSpeed( tor->bandwidth, dir, KiB_sec );
    118118}
    119119
     
    124124    assert( tr_isDirection( dir ) );
    125125
    126     return tr_bandwidthGetDesiredSpeed( &tor->bandwidth, dir );
     126    return tr_bandwidthGetDesiredSpeed( tor->bandwidth, dir );
    127127}
    128128
     
    133133    assert( tr_isDirection( dir ) );
    134134
    135     tr_bandwidthSetLimited( &tor->bandwidth, dir, do_use );
     135    tr_bandwidthSetLimited( tor->bandwidth, dir, do_use );
    136136}
    137137
     
    142142    assert( tr_isDirection( dir ) );
    143143
    144     return tr_bandwidthIsLimited( &tor->bandwidth, dir );
     144    return tr_bandwidthIsLimited( tor->bandwidth, dir );
    145145}
    146146
     
    150150    assert( tr_isTorrent( tor ) );
    151151
    152     tr_bandwidthHonorParentLimits( &tor->bandwidth, TR_UP, doUse );
    153     tr_bandwidthHonorParentLimits( &tor->bandwidth, TR_DOWN, doUse );
     152    tr_bandwidthHonorParentLimits( tor->bandwidth, TR_UP, doUse );
     153    tr_bandwidthHonorParentLimits( tor->bandwidth, TR_DOWN, doUse );
    154154}
    155155
     
    159159    assert( tr_isTorrent( tor ) );
    160160
    161     return tr_bandwidthAreParentLimitsHonored( &tor->bandwidth, TR_UP );
     161    return tr_bandwidthAreParentLimitsHonored( tor->bandwidth, TR_UP );
    162162}
    163163
     
    543543    randomizeTiers( info );
    544544
    545     tr_bandwidthConstruct( &tor->bandwidth, session, session->bandwidth );
     545    tor->bandwidth = tr_bandwidthNew( session, session->bandwidth );
    546546
    547547    tor->blockSize = getBlockSize( info->pieceSize );
     
    886886    d = tr_peerMgrGetWebseedSpeed( tor, now );
    887887    s->swarmSpeed         = tr_rcRate( &tor->swarmSpeed, now );
    888     s->rawUploadSpeed     = tr_bandwidthGetRawSpeed  ( &tor->bandwidth, now, TR_UP );
    889     s->pieceUploadSpeed   = tr_bandwidthGetPieceSpeed( &tor->bandwidth, now, TR_UP );
    890     s->rawDownloadSpeed   = d + tr_bandwidthGetRawSpeed  ( &tor->bandwidth, now, TR_DOWN );
    891     s->pieceDownloadSpeed = d + tr_bandwidthGetPieceSpeed( &tor->bandwidth, now, TR_DOWN );
     888    s->rawUploadSpeed     = tr_bandwidthGetRawSpeed  ( tor->bandwidth, now, TR_UP );
     889    s->pieceUploadSpeed   = tr_bandwidthGetPieceSpeed( tor->bandwidth, now, TR_UP );
     890    s->rawDownloadSpeed   = d + tr_bandwidthGetRawSpeed  ( tor->bandwidth, now, TR_DOWN );
     891    s->pieceDownloadSpeed = d + tr_bandwidthGetPieceSpeed( tor->bandwidth, now, TR_DOWN );
    892892
    893893    usableSeeds += tor->info.webseedCount;
     
    12111211    session->torrentCount--;
    12121212
    1213     tr_bandwidthDestruct( &tor->bandwidth );
     1213    tr_bandwidthFree( tor->bandwidth );
    12141214
    12151215    tr_metainfoFree( inf );
     
    17401740    assert( tr_isTorrent( tor ) );
    17411741
    1742     return tor->bandwidth.priority;
     1742    return tor->bandwidth->priority;
    17431743}
    17441744
     
    17491749    assert( tr_isPriority( priority ) );
    17501750
    1751     tor->bandwidth.priority = priority;
     1751    tor->bandwidth->priority = priority;
    17521752}
    17531753
  • trunk/libtransmission/torrent.h

    r8693 r8709  
    1818#define TR_TORRENT_H 1
    1919
    20 #include "bandwidth.h" /* tr_bandwidth */
    2120#include "completion.h" /* tr_completion */
    2221#include "ratecontrol.h" /* tr_ratecontrol */
     
    174173    tr_completeness            completeness;
    175174
    176     struct tr_bandwidth        bandwidth;
    177 
    178175    struct tr_tracker *        tracker;
    179176    struct tr_publisher_tag *  trackerSubscription;
     
    217214    int                        uniqueId;
    218215
     216    struct tr_bandwidth      * bandwidth;
     217
    219218    struct tr_torrent_peers  * torrentPeers;
    220219
Note: See TracChangeset for help on using the changeset viewer.