From 9a9041cf7dbc8191e98ecf899a80bde0cd5a04f8 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 16 Jul 2014 21:08:18 -0700 Subject: [PATCH] server: fix support for client break; show it on web --- db/boinc_db_types.h | 2 -- html/inc/host.inc | 9 +++++++-- sched/handle_request.cpp | 4 ++-- sched/sched_types.cpp | 5 ++++- sched/sched_types.h | 2 ++ 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/db/boinc_db_types.h b/db/boinc_db_types.h index 2f23ab98bc..1580ac3568 100644 --- a/db/boinc_db_types.h +++ b/db/boinc_db_types.h @@ -347,8 +347,6 @@ struct HOST { // char p_features[1024]; char virtualbox_version[256]; - char client_brand[256]; - // as specific in client_brand.txt config file on client bool p_vm_extensions_disabled; int num_opencl_cpu_platforms; OPENCL_CPU_PROP opencl_cpu_prop[MAX_OPENCL_CPU_PLATFORMS]; diff --git a/html/inc/host.inc b/html/inc/host.inc index 610973bef2..455075213a 100644 --- a/html/inc/host.inc +++ b/html/inc/host.inc @@ -305,9 +305,14 @@ function gpu_desc($x) { function boinc_version($x) { $y = strstr($x, 'BOINC'); if (!$y) return ''; - $y = substr($y, 6); $z = explode("]", $y, 2); - return $z[0]; + $a = explode('|', $z[0]); + $v = $a[1]; + if (array_key_exists(2, $a)) { + $brand = $a[2]; + $v .= " ($brand)"; + } + return $v; } function cpu_desc($host) { diff --git a/sched/handle_request.cpp b/sched/handle_request.cpp index dff726bdab..aa62db9808 100644 --- a/sched/handle_request.cpp +++ b/sched/handle_request.cpp @@ -505,9 +505,9 @@ static int modify_host_struct(HOST& host) { g_request->core_client_minor_version, g_request->core_client_release ); - if (strlen(host.client_brand)) { + if (strlen(g_request->client_brand)) { strcat(buf, "|"); - strcat(buf, host.client_brand); + strcat(buf, g_request->client_brand); } strcat(buf, "]"); g_request->coprocs.summary_string(buf2, sizeof(buf2)); diff --git a/sched/sched_types.cpp b/sched/sched_types.cpp index b2602f3662..edc2ffd524 100644 --- a/sched/sched_types.cpp +++ b/sched/sched_types.cpp @@ -184,6 +184,7 @@ const char* SCHEDULER_REQUEST::parse(XML_PARSER& xp) { strcpy(authenticator, ""); strcpy(platform.name, ""); strcpy(cross_project_id, ""); + strcpy(client_brand, ""); hostid = 0; core_client_major_version = 0; core_client_minor_version = 0; @@ -423,6 +424,9 @@ const char* SCHEDULER_REQUEST::parse(XML_PARSER& xp) { if (xp.parse_int("sandbox", sandbox)) continue; if (xp.parse_int("allow_multiple_clients", allow_multiple_clients)) continue; if (xp.parse_string("client_opaque", client_opaque)) continue; + if (xp.parse_str("client_brand", client_brand, sizeof(client_brand))) continue; + + // unused or deprecated stuff follows if (xp.match_tag("active_task_set")) continue; if (xp.match_tag("app")) continue; @@ -1249,7 +1253,6 @@ int HOST::parse(XML_PARSER& xp) { if (xp.parse_double("n_bwdown", n_bwdown)) continue; if (xp.parse_str("p_features", p_features, sizeof(p_features))) continue; if (xp.parse_str("virtualbox_version", virtualbox_version, sizeof(virtualbox_version))) continue; - if (xp.parse_str("client_brand", client_brand, sizeof(client_brand))) continue; if (xp.parse_bool("p_vm_extensions_disabled", p_vm_extensions_disabled)) continue; if (xp.match_tag("opencl_cpu_prop")) { int retval = opencl_cpu_prop[num_opencl_cpu_platforms].parse(xp); diff --git a/sched/sched_types.h b/sched/sched_types.h index 62c0e35f27..7efb71cbf0 100644 --- a/sched/sched_types.h +++ b/sched/sched_types.h @@ -287,6 +287,8 @@ struct SCHEDULER_REQUEST { char working_global_prefs_xml[BLOB_SIZE]; char code_sign_key[4096]; bool dont_send_work; + char client_brand[256]; + // as specifiedc in client_brand.txt config file on client std::vector client_app_versions;