From f4b8bc55065b53d59aefb0d291e726d6fe4369f0 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 6 Feb 2006 23:56:08 +0000 Subject: [PATCH] want_network_flag logic svn path=/trunk/boinc/; revision=9406 --- checkin_notes | 9 +++++++++ client/acct_setup.C | 12 ++++++------ client/acct_setup.h | 10 +++++----- client/gui_http.C | 2 +- client/gui_http.h | 2 +- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/checkin_notes b/checkin_notes index fc44cb57fa..15af912793 100755 --- a/checkin_notes +++ b/checkin_notes @@ -1517,3 +1517,12 @@ Charlie 2 Feb 2006 app.h app_graphics.C app_start.C + +David 6 Feb 2006 + - Slight refinement to next-earlier checkin. + Set want_network_flag only if the request to the reference network site + results in a CURLE_COULDNT_RESOLVE_HOST Curl error code. + + client/ + acct_setup.C,h + gui_http.C,h diff --git a/client/acct_setup.C b/client/acct_setup.C index 6b1c2a1a72..c79b337f45 100644 --- a/client/acct_setup.C +++ b/client/acct_setup.C @@ -101,7 +101,7 @@ int GET_PROJECT_CONFIG_OP::do_rpc(string master_url) { return retval; } -void GET_PROJECT_CONFIG_OP::handle_reply(int http_op_retval) { +void GET_PROJECT_CONFIG_OP::handle_reply(int http_op_retval, int) { if (http_op_retval) { error_num = http_op_retval; } else { @@ -130,7 +130,7 @@ int LOOKUP_ACCOUNT_OP::do_rpc(ACCOUNT_IN& ai) { return retval; } -void LOOKUP_ACCOUNT_OP::handle_reply(int http_op_retval) { +void LOOKUP_ACCOUNT_OP::handle_reply(int http_op_retval, int) { if (http_op_retval) { error_num = http_op_retval; } else { @@ -159,7 +159,7 @@ int CREATE_ACCOUNT_OP::do_rpc(ACCOUNT_IN& ai) { return retval; } -void CREATE_ACCOUNT_OP::handle_reply(int http_op_retval) { +void CREATE_ACCOUNT_OP::handle_reply(int http_op_retval, int) { if (http_op_retval) { error_num = http_op_retval; } else { @@ -186,7 +186,7 @@ int LOOKUP_WEBSITE_OP::do_rpc(string& url) { return retval; } -void LOOKUP_WEBSITE_OP::handle_reply(int http_op_retval) { +void LOOKUP_WEBSITE_OP::handle_reply(int http_op_retval, int CurlResult) { error_num = http_op_retval; // if we couldn't contact a reference web site, @@ -194,7 +194,7 @@ void LOOKUP_WEBSITE_OP::handle_reply(int http_op_retval) { // (usually no physical network connection). // Set a flag that will signal the Manager to that effect // - if (error_num) { + if (CurlResult == CURLE_COULDNT_RESOLVE_HOST) { gstate.want_network_flag = true; } } @@ -245,7 +245,7 @@ static bool parse_version(FILE* f, char* new_version) { return false; } -void GET_CURRENT_VERSION_OP::handle_reply(int http_op_retval) { +void GET_CURRENT_VERSION_OP::handle_reply(int http_op_retval, int) { char buf[256], new_version[256]; if (http_op_retval) { error_num = http_op_retval; diff --git a/client/acct_setup.h b/client/acct_setup.h index 41c8ff7998..13cf272baa 100644 --- a/client/acct_setup.h +++ b/client/acct_setup.h @@ -56,7 +56,7 @@ struct GET_PROJECT_CONFIG_OP: public GUI_HTTP_OP { virtual ~GET_PROJECT_CONFIG_OP(){} int do_rpc(string url); - virtual void handle_reply(int http_op_retval); + virtual void handle_reply(int http_op_retval, int); GET_PROJECT_CONFIG_OP(){error_num = BOINC_SUCCESS;} }; @@ -66,7 +66,7 @@ struct LOOKUP_ACCOUNT_OP: public GUI_HTTP_OP { virtual ~LOOKUP_ACCOUNT_OP(){} int do_rpc(ACCOUNT_IN&); - virtual void handle_reply(int http_op_retval); + virtual void handle_reply(int http_op_retval, int); LOOKUP_ACCOUNT_OP(){error_num = BOINC_SUCCESS;} }; @@ -76,7 +76,7 @@ struct CREATE_ACCOUNT_OP: public GUI_HTTP_OP { virtual ~CREATE_ACCOUNT_OP(){} int do_rpc(ACCOUNT_IN&); - virtual void handle_reply(int http_op_retval); + virtual void handle_reply(int http_op_retval, int); CREATE_ACCOUNT_OP(){error_num = BOINC_SUCCESS;} }; @@ -85,7 +85,7 @@ struct LOOKUP_WEBSITE_OP: public GUI_HTTP_OP { virtual ~LOOKUP_WEBSITE_OP(){} int do_rpc(std::string&); - virtual void handle_reply(int http_op_retval); + virtual void handle_reply(int http_op_retval, int); LOOKUP_WEBSITE_OP(){error_num = BOINC_SUCCESS;} }; @@ -94,7 +94,7 @@ struct GET_CURRENT_VERSION_OP: public GUI_HTTP_OP { virtual ~GET_CURRENT_VERSION_OP(){} int do_rpc(); - virtual void handle_reply(int http_op_retval); + virtual void handle_reply(int http_op_retval, int); GET_CURRENT_VERSION_OP(){error_num = BOINC_SUCCESS;} }; diff --git a/client/gui_http.C b/client/gui_http.C index 3040d41d64..cfa387b592 100644 --- a/client/gui_http.C +++ b/client/gui_http.C @@ -74,7 +74,7 @@ bool GUI_HTTP::poll() { if (http_op.http_op_state == HTTP_STATE_DONE) { gstate.http_ops->remove(&http_op); - gui_http_op->handle_reply(http_op.http_op_retval); + gui_http_op->handle_reply(http_op.http_op_retval, http_op.CurlResult); gui_http_op = NULL; state = GUI_HTTP_STATE_IDLE; } diff --git a/client/gui_http.h b/client/gui_http.h index 64e882d8b6..46da700195 100644 --- a/client/gui_http.h +++ b/client/gui_http.h @@ -31,7 +31,7 @@ using std::string; // base class for various types of ops // struct GUI_HTTP_OP { - virtual void handle_reply(int) {} + virtual void handle_reply(int, int) {} GUI_HTTP_OP(){} virtual ~GUI_HTTP_OP(){} };