diff --git a/checkin_notes b/checkin_notes index 37c8a21faf..6bfc5b83f9 100755 --- a/checkin_notes +++ b/checkin_notes @@ -18560,3 +18560,11 @@ David 19 Oct 2004 client/ cs_apps.C gui_rpc_server.C + +David 19 Oct 2004 + - fix GUI RPC client so it won't get confused if different + projects have the same app, WU or result names + + lib/ + gui_rpc_client.C,h + makefile.gui_test diff --git a/lib/gui_rpc_client.C b/lib/gui_rpc_client.C index c76ee313d8..aab6693362 100644 --- a/lib/gui_rpc_client.C +++ b/lib/gui_rpc_client.C @@ -627,35 +627,41 @@ PROJECT* CC_STATE::lookup_project(string& str) { return 0; } -APP* CC_STATE::lookup_app(string& str) { +APP* CC_STATE::lookup_app(PROJECT* project, string& str) { unsigned int i; for (i=0; iproject != project) continue; if (apps[i]->name == str) return apps[i]; } printf("CAN'T FIND APP %s\n", str.c_str()); return 0; } -APP_VERSION* CC_STATE::lookup_app_version(string& str, int version_num) { +APP_VERSION* CC_STATE::lookup_app_version( + PROJECT* project, string& str, int version_num +) { unsigned int i; for (i=0; iproject != project) continue; if (app_versions[i]->app_name == str && app_versions[i]->version_num == version_num) return app_versions[i]; } return 0; } -WORKUNIT* CC_STATE::lookup_wu(string& str) { +WORKUNIT* CC_STATE::lookup_wu(PROJECT* project, string& str) { unsigned int i; for (i=0; iproject != project) continue; if (wus[i]->name == str) return wus[i]; } printf("CAN'T FIND WU %s\n", str.c_str()); return 0; } -RESULT* CC_STATE::lookup_result(string& str) { +RESULT* CC_STATE::lookup_result(PROJECT* project, string& str) { unsigned int i; for (i=0; iproject != project) continue; if (results[i]->name == str) return results[i]; } printf("CAN'T FIND RESULT %s\n", str.c_str()); @@ -890,7 +896,7 @@ int RPC_CLIENT::get_state(CC_STATE& state) { APP_VERSION* app_version = new APP_VERSION(); app_version->parse(rpc.fin); app_version->project = project; - app_version->app = state.lookup_app(app_version->app_name); + app_version->app = state.lookup_app(project, app_version->app_name); state.app_versions.push_back(app_version); continue; } @@ -898,8 +904,8 @@ int RPC_CLIENT::get_state(CC_STATE& state) { WORKUNIT* wu = new WORKUNIT(); wu->parse(rpc.fin); wu->project = project; - wu->app = state.lookup_app(wu->app_name); - wu->avp = state.lookup_app_version(wu->app_name, wu->version_num); + wu->app = state.lookup_app(project, wu->app_name); + wu->avp = state.lookup_app_version(project, wu->app_name, wu->version_num); state.wus.push_back(wu); continue; } @@ -907,7 +913,7 @@ int RPC_CLIENT::get_state(CC_STATE& state) { RESULT* result = new RESULT(); result->parse(rpc.fin); result->project = project; - result->wup = state.lookup_wu(result->wu_name); + result->wup = state.lookup_wu(project, result->wu_name); result->app = result->wup->app; state.results.push_back(result); continue; diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index 733bf10195..045d01f1f2 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -259,10 +259,10 @@ public: ~CC_STATE(); PROJECT* lookup_project(std::string&); - APP* lookup_app(std::string&); - APP_VERSION* lookup_app_version(std::string&, int); - WORKUNIT* lookup_wu(std::string&); - RESULT* lookup_result(std::string&); + APP* lookup_app(PROJECT*, std::string&); + APP_VERSION* lookup_app_version(PROJECT*, std::string&, int); + WORKUNIT* lookup_wu(PROJECT*, std::string&); + RESULT* lookup_result(PROJECT*, std::string&); void print(); void clear(); diff --git a/lib/makefile.gui_test b/lib/makefile.gui_test index 0d5c512985..ab100aaf35 100644 --- a/lib/makefile.gui_test +++ b/lib/makefile.gui_test @@ -1,5 +1,5 @@ -// uncomment the following for Solaris -//LIBS = -lnsl -lsocket +# uncomment the following for Solaris +LIBS = -lnsl -lsocket gui_test: gui_test.C gui_rpc_client.C gui_rpc_client.h g++ -g -I../lib -o gui_test $(LIBS) gui_test.C gui_rpc_client.C ../lib/libboinc.a