From d40654c9cecae4e2f0033c7fdc18f57f10d0527e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 15 Oct 2004 19:19:03 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4331 --- api/boinc_api.h | 4 ++++ checkin_notes | 9 +++++++++ client/gui_rpc_server.C | 11 +++++++++-- client/scheduler_op.C | 31 ++++++++++++++++--------------- doc/contact.php | 1 + 5 files changed, 39 insertions(+), 17 deletions(-) diff --git a/api/boinc_api.h b/api/boinc_api.h index a983c9b5f1..17fda82a38 100755 --- a/api/boinc_api.h +++ b/api/boinc_api.h @@ -76,6 +76,8 @@ extern "C" { extern int boinc_wu_cpu_time(double&); extern int boinc_calling_thread_cpu_time(double&, double&); + extern int boinc_suspend_other_activities(); + extern int boinc_resume_other_activities(); } // extern "C" extern APP_INIT_DATA aid; @@ -86,10 +88,12 @@ extern APP_INIT_DATA aid; extern APP_CLIENT_SHM *app_client_shm; +#if 0 #ifdef HAVE_SIGNAL_H extern void boinc_catch_signal(int signal); extern void boinc_quit(int sig); #endif +#endif /////////// IMPLEMENTATION STUFF ENDS HERE diff --git a/checkin_notes b/checkin_notes index aaec7a5145..da8c1032b3 100755 --- a/checkin_notes +++ b/checkin_notes @@ -18428,3 +18428,12 @@ Lana 14 Oct 2004 sched/ db_purge.C + +David 15 Oct 2004 + - GUI RPC: don't crash if bad project URL + - SCHEDULER_REPLY::parse(): tolerate extra lines + at start of scheduler reply (from Volker Hatzenberger) + + client/ + gui_rpc_server.C + scheduler_op.C diff --git a/client/gui_rpc_server.C b/client/gui_rpc_server.C index 32ac2c7b4b..3365672ffd 100644 --- a/client/gui_rpc_server.C +++ b/client/gui_rpc_server.C @@ -156,6 +156,7 @@ static void handle_project_op(char* buf, MIOFILE& fout, char* op) { PROJECT* p = get_project(buf, fout); if (!p) { fout.printf("no such project\n"); + return; } if (!strcmp(op, "reset")) { gstate.reset_project(p); @@ -317,7 +318,10 @@ static void handle_file_transfer_op(char* buf, MIOFILE& fout, char* op) { string filename; PROJECT* p = get_project(buf, fout); - if (!p) return; + if (!p) { + fout.printf("No such project\n"); + return; + } if (!parse_str(buf, "", filename)) { fout.printf("Missing filename\n"); @@ -352,7 +356,10 @@ static void handle_result_op(char* buf, MIOFILE& fout, char* op) { ACTIVE_TASK* atp; PROJECT* p = get_project(buf, fout); - if (!p) return; + if (!p) { + fout.printf("No such project\n"); + return; + } if (!parse_str(buf, "", result_name, sizeof(result_name))) { fout.printf("Missing result name\n"); diff --git a/client/scheduler_op.C b/client/scheduler_op.C index a550dde614..70d8f8894a 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -568,11 +568,12 @@ SCHEDULER_REPLY::~SCHEDULER_REPLY() { // Others are copied straight to the PROJECT // int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { - char buf[256], *p; + char buf[256]; int retval, x; MIOFILE mf; char delete_file_name[256]; mf.init_file(in); + bool found_start_tag = false; SCOPE_MSG_LOG scope_messages(log_messages, CLIENT_MSG_LOG::DEBUG_SCHED_OP); @@ -589,21 +590,17 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { project_is_down = false; send_file_list = false; - p = fgets(buf, 256, in); - if (!p) { - msg_printf(project, MSG_ERROR, "SCHEDULER_REPLY::parse(): empty file\n"); - return ERR_XML_PARSE; - } - // First part of content should either be tag (HTTP 1.0) or + // First line should either be tag (HTTP 1.0) or // hex length of response (HTTP 1.1) - if (!match_tag(buf, "")) { - msg_printf(project, MSG_ERROR, "SCHEDULER_REPLY::parse(): bad first tag %s\n", buf); - return ERR_XML_PARSE; - } + // while (fgets(buf, 256, in)) { - if (match_tag(buf, "")) { - // Do nothing - } else if (match_tag(buf, "")) return 0; + if (!found_start_tag) { + if (match_tag(buf, "")) return 0; else if (parse_str(buf, "", project->project_name, sizeof(project->project_name))) continue; else if (parse_str(buf, "", project->user_name, sizeof(project->user_name))) continue; else if (parse_double(buf, "", project->user_total_credit)) continue; @@ -744,6 +741,10 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { scope_messages.printf("SCHEDULER_REPLY::parse(): unrecognized %s\n", buf); } } - msg_printf(project, MSG_ERROR, "SCHEDULER_REPLY::parse(): no close tag\n"); + if (found_start_tag) { + msg_printf(project, MSG_ERROR, "No close tag in scheduler reply\n"); + } else { + msg_printf(project, MSG_ERROR, "No start tag in scheduler reply\n"); + } return ERR_XML_PARSE; } diff --git a/doc/contact.php b/doc/contact.php index f606b27673..b0da0320d0 100644 --- a/doc/contact.php +++ b/doc/contact.php @@ -31,6 +31,7 @@ show_name("Markku Degerholm"); show_name("James Drews"); show_name("Michael Gary"); show_name("Gary Gibson"); +show_name("Volker Hatzenberger"); show_name("Ian Hay"); show_name("Eric Heien"); show_name("Thomas Horsten");