From c28a4ef65976f58bfe1103073abe1cae7bbc6750 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 26 Dec 2011 04:56:36 +0000 Subject: [PATCH] - make "needs network" a property of APP_VERSION rather than APP svn path=/trunk/boinc/; revision=24900 --- checkin_notes | 7 +++++++ client/app_control.cpp | 1 - client/client_types.cpp | 16 +++++++++------- client/client_types.h | 2 +- client/work_fetch.cpp | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/checkin_notes b/checkin_notes index 3da1c5616c..fc98151483 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9529,3 +9529,10 @@ David 26 Dec 2011 gui_rpc_client.h gui_rpc_client_ops.cpp +David 26 Dec 2011 + - make "needs network" a property of APP_VERSION rather than APP + + client/ + client_types.cpp,h + work_fetch.cpp + app_control.cpp diff --git a/client/app_control.cpp b/client/app_control.cpp index e360c88f47..18ee59d60a 100644 --- a/client/app_control.cpp +++ b/client/app_control.cpp @@ -1194,7 +1194,6 @@ void ACTIVE_TASK::get_graphics_msg() { if (app_client_shm.shm->graphics_reply.get_msg(msg_buf)) { parse_str(msg_buf, "", web_graphics_url, sizeof(web_graphics_url)); } - strcpy(web_graphics_url, "http://google.com"); } bool ACTIVE_TASK::get_trickle_up_msg() { diff --git a/client/client_types.cpp b/client/client_types.cpp index 38613a73ee..60801eea27 100644 --- a/client/client_types.cpp +++ b/client/client_types.cpp @@ -782,12 +782,10 @@ void PROJECT::update_project_files_downloaded_time() { } int APP::parse(XML_PARSER& xp) { - strcpy(name, ""); strcpy(user_friendly_name, ""); project = NULL; non_cpu_intensive = false; - needs_network = false; while (!xp.get_tag()) { if (xp.match_tag("/app")) { if (!strlen(user_friendly_name)) { @@ -811,7 +809,6 @@ int APP::parse(XML_PARSER& xp) { continue; } if (xp.parse_bool("non_cpu_intensive", non_cpu_intensive)) continue; - if (xp.parse_bool("needs_network", needs_network)) continue; #endif if (log_flags.unparsed_xml) { msg_printf(0, MSG_INFO, @@ -830,11 +827,9 @@ int APP::write(MIOFILE& out) { " %s\n" " %s\n" " %d\n" - " %d\n" "\n", name, user_friendly_name, - non_cpu_intensive?1:0, - needs_network?1:0 + non_cpu_intensive?1:0 ); return 0; } @@ -1297,6 +1292,7 @@ int APP_VERSION::parse(XML_PARSER& xp) { missing_coproc = false; strcpy(missing_coproc_name, ""); dont_throttle = false; + needs_network = false; while (!xp.get_tag()) { if (xp.match_tag("/app_version")) return 0; @@ -1344,6 +1340,7 @@ int APP_VERSION::parse(XML_PARSER& xp) { continue; } if (xp.parse_bool("dont_throttle", dont_throttle)) continue; + if (xp.parse_bool("needs_network", needs_network)) continue; if (log_flags.unparsed_xml) { msg_printf(0, MSG_INFO, "[unparsed_xml] APP_VERSION::parse(): unrecognized: %s\n", @@ -1425,6 +1422,11 @@ int APP_VERSION::write(MIOFILE& out, bool write_file_info) { " \n" ); } + if (needs_network) { + out.printf( + " \n" + ); + } out.printf( "\n" @@ -1939,7 +1941,7 @@ int RESULT::write_gui(MIOFILE& out) { if (edf_scheduled) out.printf(" \n"); if (coproc_missing) out.printf(" \n"); if (schedule_backoff > gstate.now) out.printf(" \n"); - if (avp->app->needs_network && gstate.network_suspended) out.printf(" \n"); + if (avp->needs_network && gstate.network_suspended) out.printf(" \n"); ACTIVE_TASK* atp = gstate.active_tasks.lookup_result(this); if (atp) { atp->write_gui(out); diff --git a/client/client_types.h b/client/client_types.h index 1695fe76c7..31a9bef955 100644 --- a/client/client_types.h +++ b/client/client_types.h @@ -543,7 +543,6 @@ struct APP { char name[256]; char user_friendly_name[256]; bool non_cpu_intensive; - bool needs_network; PROJECT* project; #ifdef SIM double latency_bound; @@ -581,6 +580,7 @@ struct APP_VERSION { char file_prefix[256]; // prepend this to input/output file logical names // (e.g. "share" for VM apps) + bool needs_network; APP* app; PROJECT* project; diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index 1365ffb685..7f472c6f22 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -959,7 +959,7 @@ bool RESULT::runnable() { if (state() != RESULT_FILES_DOWNLOADED) return false; if (coproc_missing) return false; if (schedule_backoff > gstate.now) return false; - if (avp->app->needs_network && gstate.network_suspended) return false; + if (avp->needs_network && gstate.network_suspended) return false; return true; }