Skip to content

Commit

Permalink
Accidentally scaled values by multiples of 1024, not 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
flan committed Jan 4, 2022
1 parent ef1465d commit c1a384c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/protocol/messaging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,22 +189,22 @@ pub fn prepare_upload_configuration(args:&clap::ArgMatches, test_id:&[u8; 16]) -
Some(v) => {
match v {
'k' => { //kilobits
bandwidth_multiplier = 1024.0 / 8.0;
bandwidth_multiplier = 1000.0 / 8.0;
},
'K' => { //kilobytes
bandwidth_multiplier = 1024.0;
bandwidth_multiplier = 1000.0;
},
'm' => { //megabits
bandwidth_multiplier = 1024.0 * 1024.0 / 8.0;
bandwidth_multiplier = 1000.0 * 1000.0 / 8.0;
},
'M' => { //megabytes
bandwidth_multiplier = 1024.0 * 1024.0;
bandwidth_multiplier = 1000.0 * 1000.0;
},
'g' => { //gigabits
bandwidth_multiplier = 1024.0 * 1024.0 * 1024.0 / 8.0;
bandwidth_multiplier = 1000.0 * 1000.0 * 1000.0 / 8.0;
},
'G' => { //gigabytes
bandwidth_multiplier = 1024.0 * 1024.0 * 1024.0;
bandwidth_multiplier = 1000.0 * 1000.0 * 1000.0;
},
_ => {
bandwidth_multiplier = 1.0;
Expand Down

0 comments on commit c1a384c

Please sign in to comment.