client: fix incorrect parsing of <max_ncpus_pct> (0 means no limit)

This commit is contained in:
Charlie Fenton 2015-02-12 04:27:11 -08:00
parent dd204ee084
commit 0773510fce
1 changed files with 4 additions and 5 deletions

View File

@ -546,11 +546,10 @@ int GLOBAL_PREFS::parse_override(
mask.max_bytes_sec_down = true;
continue;
}
if (xp.parse_double("cpu_usage_limit", dtemp)) {
if (dtemp > 0 && dtemp <= 100) {
cpu_usage_limit = dtemp;
mask.cpu_usage_limit = true;
}
if (xp.parse_double("cpu_usage_limit", cpu_usage_limit)) {
if (cpu_usage_limit < 0) cpu_usage_limit = 0;
if (cpu_usage_limit > 100) cpu_usage_limit = 100;
mask.cpu_usage_limit = true;
continue;
}
if (xp.parse_double("daily_xfer_limit_mb", dtemp)) {