From 1c8be406c0b40ad2d23e14ace75ffd9046eba630 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 12 Sep 2010 19:35:53 +0000 Subject: [PATCH] (trunk daemon) #3547: "regression: wrong speed display in transission-remote and web ui" -- apply KyleK's patch for transmission-remote --- daemon/remote.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index 114d2b145..d50038168 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -836,10 +836,10 @@ printDetails( tr_benc * top ) if( tr_bencDictFindInt( t, "eta", &i ) ) printf( " ETA: %s\n", tr_strltime( buf, i, sizeof( buf ) ) ); - if( tr_bencDictFindReal( t, "rateDownload", &d ) ) - printf( " Download Speed: %s\n", tr_formatter_speed_KBps( buf, d, sizeof( buf ) ) ); - if( tr_bencDictFindReal( t, "rateUpload", &d ) ) - printf( " Upload Speed: %s\n", tr_formatter_speed_KBps( buf, d, sizeof( buf ) ) ); + if( tr_bencDictFindInt( t, "rateDownload", &i ) ) + printf( " Download Speed: %s\n", tr_formatter_speed_KBps( buf, i/(double)tr_speed_K, sizeof( buf ) ) ); + if( tr_bencDictFindInt( t, "rateUpload", &i ) ) + printf( " Upload Speed: %s\n", tr_formatter_speed_KBps( buf, i/(double)tr_speed_K, sizeof( buf ) ) ); if( tr_bencDictFindInt( t, "haveUnchecked", &i ) && tr_bencDictFindInt( t, "haveValid", &j ) ) { @@ -1258,8 +1258,8 @@ printTorrentList( tr_benc * top ) printf( "Sum: %9s %6.1f %6.1f\n", strlsize( haveStr, total_size, sizeof( haveStr ) ), - total_up, - total_down ); + total_up/(double)tr_speed_K, + total_down/(double)tr_speed_K ); } }