Ignore:
Timestamp:
Dec 30, 2006, 7:24:09 PM (16 years ago)
Author:
livings124
Message:

move ratio from mac code to libT code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/transmission.c

    r1288 r1302  
    561561    s->downloaded = tor->downloadedCur + tor->downloadedPrev;
    562562    s->uploaded   = tor->uploadedCur   + tor->uploadedPrev;
    563 
     563   
     564    if( s->downloaded == 0 )
     565    {
     566        s->ratio = s->uploaded == 0 ? TR_RATIO_NA : TR_RATIO_INF;
     567    }
     568    else
     569    {
     570        s->ratio = (float)s->uploaded / (float)s->downloaded;
     571    }
     572   
    564573    tr_lockUnlock( &tor->lock );
    565574
Note: See TracChangeset for help on using the changeset viewer.