From c7fe57ad41b2eeecf273083297120e250afc6be4 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 10 Aug 2006 17:36:28 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=10878 --- checkin_notes | 12 +++++++++++- client/client_state.h | 2 +- client/cs_apps.C | 12 ++++-------- client/cs_scheduler.C | 3 ++- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/checkin_notes b/checkin_notes index 810d75606c..367832fae5 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8602,10 +8602,20 @@ David 9 Aug 2006 html/inc/ util.inc -David 9 Aug 2006 +David 10 Aug 2006 - add certificate authority bundle file to linux release client/ cpu_sched.C sea/ Makefile.am + +David 10 Aug 2006 + - core client: choose_version_num(): fix bug that could happen + if two projects have app with same name + (from Josef Segur) + + client/ + client_state.h + cs_apps.C + cs_scheduler.C diff --git a/client/client_state.h b/client/client_state.h index a5520abf97..1fd04378da 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -317,7 +317,7 @@ public: private: int nslots; - int choose_version_num(char*, SCHEDULER_REPLY&); + int choose_version_num(WORKUNIT*, SCHEDULER_REPLY&); int app_finished(ACTIVE_TASK&); bool start_apps(); bool handle_finished_apps(); diff --git a/client/cs_apps.C b/client/cs_apps.C index 1cb75cf358..39bd668aa9 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -325,7 +325,7 @@ double CLIENT_STATE::get_fraction_done(RESULT* result) { // Decide which app version to use for a WU. // Return -1 if can't find one // -int CLIENT_STATE::choose_version_num(char* app_name, SCHEDULER_REPLY& sr) { +int CLIENT_STATE::choose_version_num(WORKUNIT* wup, SCHEDULER_REPLY& sr) { unsigned int i; int best = -1; APP_VERSION* avp; @@ -334,7 +334,7 @@ int CLIENT_STATE::choose_version_num(char* app_name, SCHEDULER_REPLY& sr) { // for (i=0; iapp_name)) { + if (!strcmp(wup->app_name, avp->app_name)) { return avp->version_num; } } @@ -343,15 +343,11 @@ int CLIENT_STATE::choose_version_num(char* app_name, SCHEDULER_REPLY& sr) { // for (i=0; iapp_name, app_name)) continue; + if (avp->project != wup->project) continue; + if (strcmp(avp->app_name, wup->app_name)) continue; if (avp->version_num < best) continue; best = avp->version_num; } - if (best < 0) { - msg_printf(0, MSG_ERROR, - "No version found for application %s", app_name - ); - } return best; } diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 38190a6056..bf1f6701e8 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -1037,7 +1037,8 @@ int CLIENT_STATE::handle_scheduler_reply( if (lookup_workunit(project, sr.workunits[i].name)) continue; WORKUNIT* wup = new WORKUNIT; *wup = sr.workunits[i]; - int vnum = choose_version_num(wup->app_name, sr); + wup->project = project; + int vnum = choose_version_num(wup, sr); if (vnum < 0) { msg_printf(project, MSG_ERROR, "Can't find application version for task %s", wup->name