From 3fc341fc604c5f005e036d0be83f7572e5769c1c Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 8 Apr 2011 00:14:01 +0000 Subject: [PATCH] - user web: fix numeric field sanitization in prefs. Fixes #1087. - client: if PREFS::max_ncpus_pct is 0, don't set it to 100; doing so prevents PREFS::max_ncpus from having any effect. svn path=/trunk/boinc/; revision=23355 --- checkin_notes | 10 ++++++++ doc/sim/sim_web.php | 57 ++++++++++++++++++++++++++++++++--------- html/inc/prefs_util.inc | 4 +-- lib/prefs.cpp | 2 +- 4 files changed, 57 insertions(+), 16 deletions(-) diff --git a/checkin_notes b/checkin_notes index b2480aa28a..1518e852b6 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2129,3 +2129,13 @@ David 6 Apr 2011 clientgui/ sg_DlgMessages.cpp + +David 6 Apr 2011 + - user web: fix numeric field sanitization in prefs. Fixes #1087. + - client: if PREFS::max_ncpus_pct is 0, don't set it to 100; + doing so prevents PREFS::max_ncpus from having any effect. + + html/inc/ + prefs_util.inc + lib/ + prefs.cpp diff --git a/doc/sim/sim_web.php b/doc/sim/sim_web.php index cbe8b38c4f..cd1221a893 100644 --- a/doc/sim/sim_web.php +++ b/doc/sim/sim_web.php @@ -61,7 +61,7 @@ function show_scenario_summary($f) { $date = date_str(filemtime("scenarios/$f")); $nsims = nsims($f); echo " - Scenario $f + $f $user->name $date $nsims @@ -79,8 +79,11 @@ function show_scenarios() { BCE emulates a BOINC client attached to one or more projects. It predicts, in a few seconds, what the BOINC client will do over a period of day or months. - This makes it easier for BOINC developers to fix bugs and improve performance. -

+ This lets you predict how future versions of BOINC + will perform on your computers. + By reporting problem situations to BOINC developers, + you can help us fix bugs and improve performance. +

Scenarios

The inputs to BCE, called scenarios, describe a particular computer and the project to which it's attached. A scenario consists of 4 files: @@ -93,28 +96,58 @@ function show_scenarios() { You can use the files from a running BOINC client to emulate that client. - You can modify these files, or create new ones, to study hypothetical hosts - (e.g. ones with a large number of CPUs, - attached to a large number of projects, and so on). + You can modify these files, or create new ones, to study hypothetical scenarios + (e.g. hosts with a large number of CPUs, + hosts attached to a large number of projects, + projects with very short or long jobs, and so on). See The BCE documentation for details.

You create a scenario by uploading these files to the BOINC server. - You can then run any number of simulations based on the scenario. +

Simulations

+ You can run simulations based on existing scenarios + (including scenarios created by other people). The parameters of a simulation include The outputs of a simulation include +

Comments and reports

+ When you examine the results of a simulation, + you may find places where the BOINC client + made bad scheduling or work-fetch decisions. + Or you find may places where the simulator doesn't + seem to be working correctly. +

+ In such cases, please add a comment to the simulation, + indicating the nature of the problem + and the simulation time when it occurred. +

+ Also, please post to the boinc_dev email list + if you have problems using BCE, + or if you have suggestions for new features.


"; show_button( @@ -127,7 +160,7 @@ function show_scenarios() { start_table(); echo " - Name + ID
Click to see simulations Who When # Simulations diff --git a/html/inc/prefs_util.inc b/html/inc/prefs_util.inc index bb1b16e275..1f954e7042 100644 --- a/html/inc/prefs_util.inc +++ b/html/inc/prefs_util.inc @@ -161,8 +161,6 @@ class NUM_SPEC { if (is_numeric($v)) { $v /= $this->scale; if ($v == 0) $v = ""; - } else { - $v = $prefs->$tag; } return " $this->suffix "; } @@ -171,7 +169,7 @@ class NUM_SPEC { if ($in == "") $in = 0; if (!is_numeric($in)) { $error = true; - $out = $x; + $out = $in; return; } $out = $in*$this->scale; diff --git a/lib/prefs.cpp b/lib/prefs.cpp index fad7c7d8cb..4c6dde669e 100644 --- a/lib/prefs.cpp +++ b/lib/prefs.cpp @@ -463,7 +463,7 @@ int GLOBAL_PREFS::parse_override( continue; } if (xp.parse_double(tag, "max_ncpus_pct", max_ncpus_pct)) { - if (max_ncpus_pct <= 0) max_ncpus_pct = 100; + if (max_ncpus_pct < 0) max_ncpus_pct = 0; if (max_ncpus_pct > 100) max_ncpus_pct = 100; mask.max_ncpus_pct = true; continue;