Ignore:
Timestamp:
Nov 8, 2008, 2:49:04 AM (10 years ago)
Author:
charles
Message:

more fucking around with the speed measurements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r7055 r7069  
    257257    h->pieceSpeed[TR_PEER_TO_CLIENT] = tr_rcInit( );
    258258    h->pieceSpeed[TR_CLIENT_TO_PEER] = tr_rcInit( );
     259    h->rawSpeed[TR_PEER_TO_CLIENT] = tr_rcInit( );
     260    h->rawSpeed[TR_CLIENT_TO_PEER] = tr_rcInit( );
    259261
    260262    if( configDir == NULL )
     
    501503***/
    502504
    503 void
    504 tr_sessionGetSpeed( const tr_handle * session,
    505                     float *           toClient,
    506                     float *           toPeer )
    507 {
    508     if( session && toClient )
    509         *toClient = tr_rcRate( session->pieceSpeed[TR_PEER_TO_CLIENT] );
    510 
    511     if( session && toPeer )
    512         *toPeer = tr_rcRate( session->pieceSpeed[TR_CLIENT_TO_PEER] );
     505double
     506tr_sessionGetPieceSpeed( const tr_session * session, tr_direction dir )
     507{
     508    assert( dir==TR_UP || dir==TR_DOWN );
     509
     510    return session ? tr_rcRate( session->pieceSpeed[dir] ) : 0.0;
     511}
     512
     513double
     514tr_sessionGetRawSpeed( const tr_session * session, tr_direction dir )
     515{
     516    assert( dir==TR_UP || dir==TR_DOWN );
     517
     518    return session ? tr_rcRate( session->rawSpeed[dir] ) : 0.0;
    513519}
    514520
     
    626632    tr_rcClose( session->pieceSpeed[TR_PEER_TO_CLIENT] );
    627633    tr_rcClose( session->pieceSpeed[TR_CLIENT_TO_PEER] );
     634    tr_rcClose( session->rawSpeed[TR_PEER_TO_CLIENT] );
     635    tr_rcClose( session->rawSpeed[TR_CLIENT_TO_PEER] );
    628636    tr_lockFree( session->lock );
    629637    for( i = 0; i < session->metainfoLookupCount; ++i )
Note: See TracChangeset for help on using the changeset viewer.