- client: run CPU benchmarks and contact ref site if platform changes

svn path=/trunk/boinc/; revision=17499
This commit is contained in:
David Anderson 2009-03-04 19:17:38 +00:00
parent 7f6196f901
commit 8689df5922
2 changed files with 25 additions and 12 deletions

View File

@ -2591,3 +2591,9 @@ David 3 Mar 2009
client/
client_state.cpp
David 3 Mar 2009
- client: run CPU benchmarks and contact ref site if platform changes
client/
client_state.cpp

View File

@ -301,10 +301,11 @@ int CLIENT_STATE::init() {
print_summary();
do_cmdline_actions();
// if new version of core client,
// - run CPU benchmarks
// - contact reference site or some project (to trigger firewall alert)
// check if version or platform has changed.
// Either of these is evidence that we're running a different
// client than previously.
//
bool new_client = false;
if ((core_client_version.major != old_major_version)
|| (core_client_version.minor != old_minor_version)
|| (core_client_version.release != old_release)
@ -316,6 +317,20 @@ int CLIENT_STATE::init() {
core_client_version.minor,
core_client_version.release
);
new_client = true;
}
if (statefile_platform_name.size() && strcmp(get_primary_platform(), statefile_platform_name.c_str())) {
msg_printf(NULL, MSG_INFO,
"Platform changed from %s to %s",
statefile_platform_name.c_str(), get_primary_platform()
);
new_client = true;
}
// if new version of client,
// - run CPU benchmarks
// - contact reference site (or some project) to trigger firewall alert
//
if (new_client) {
run_cpu_benchmarks = true;
if (config.dont_contact_ref_site) {
if (projects.size() > 0) {
@ -326,6 +341,7 @@ int CLIENT_STATE::init() {
}
}
// show host IDs and venues on various projects
//
for (i=0; i<projects.size(); i++) {
@ -389,15 +405,6 @@ int CLIENT_STATE::init() {
if (retval) return retval;
}
// If platform name changed, print warning
//
if (statefile_platform_name.size() && strcmp(get_primary_platform(), statefile_platform_name.c_str())) {
msg_printf(NULL, MSG_INFO,
"Platform changed from %s to %s",
statefile_platform_name.c_str(), get_primary_platform()
);
}
#ifdef SANDBOX
get_project_gid();
#endif