Changeset 10967 for trunk/daemon/remote.c
- Timestamp:
- Jul 7, 2010, 5:53:16 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/remote.c
r10955 r10967 822 822 if( tr_bencDictFindInt( t, "eta", &i ) ) 823 823 printf( " ETA: %s\n", tr_strltime( buf, i, sizeof( buf ) ) ); 824 if( tr_bencDictFind Int( t, "rateDownload", &i) )825 printf( " Download Speed: %s\n", tr_formatter_speed_KBps( buf, i, sizeof( buf ) ) );826 if( tr_bencDictFind Int( t, "rateUpload", &i) )827 printf( " Upload Speed: %s\n", tr_formatter_speed_KBps( buf, i, sizeof( buf ) ) );824 if( tr_bencDictFindReal( t, "rateDownload", &d ) ) 825 printf( " Download Speed: %s\n", tr_formatter_speed_KBps( buf, d, sizeof( buf ) ) ); 826 if( tr_bencDictFindReal( t, "rateUpload", &d ) ) 827 printf( " Upload Speed: %s\n", tr_formatter_speed_KBps( buf, d, sizeof( buf ) ) ); 828 828 if( tr_bencDictFindInt( t, "haveUnchecked", &i ) 829 829 && tr_bencDictFindInt( t, "haveValid", &j ) ) … … 1283 1283 { 1284 1284 int i, n; 1285 int64_t total_up = 0, total_down = 0, total_size = 0; 1285 int64_t total_size=0; 1286 double total_up=0, total_down=0; 1286 1287 char haveStr[32]; 1287 1288 … … 1292 1293 for( i = 0, n = tr_bencListSize( list ); i < n; ++i ) 1293 1294 { 1294 int64_t id, eta, status , up, down;1295 int64_t id, eta, status; 1295 1296 int64_t sizeWhenDone, leftUntilDone; 1296 double ratio ;1297 double ratio, up, down; 1297 1298 const char * name; 1298 1299 tr_benc * d = tr_bencListChild( list, i ); … … 1301 1302 && tr_bencDictFindInt( d, "leftUntilDone", &leftUntilDone ) 1302 1303 && tr_bencDictFindStr( d, "name", &name ) 1303 && tr_bencDictFind Int( d, "rateDownload", &down )1304 && tr_bencDictFind Int( d, "rateUpload", &up )1304 && tr_bencDictFindReal( d, "rateDownload", &down ) 1305 && tr_bencDictFindReal( d, "rateUpload", &up ) 1305 1306 && tr_bencDictFindInt( d, "sizeWhenDone", &sizeWhenDone ) 1306 1307 && tr_bencDictFindInt( d, "status", &status ) … … 1335 1336 haveStr, 1336 1337 etaStr, 1337 up / (double)SPEED_K,1338 down / (double)SPEED_K,1338 up, 1339 down, 1339 1340 strlratio2( ratioStr, ratio, sizeof( ratioStr ) ), 1340 1341 getStatusString( d, statusStr, sizeof( statusStr ) ), … … 1349 1350 printf( "Sum: %9s %6.1f %6.1f\n", 1350 1351 strlsize( haveStr, total_size, sizeof( haveStr ) ), 1351 total_up / (double)SPEED_K,1352 total_down / (double)SPEED_K);1352 total_up, 1353 total_down ); 1353 1354 } 1354 1355 }
Note: See TracChangeset
for help on using the changeset viewer.