diff --git a/checkin_notes b/checkin_notes
index 429cc65c67..b9955002d4 100755
--- a/checkin_notes
+++ b/checkin_notes
@@ -11787,3 +11787,21 @@ Rom 14 Sept 2005
lib/
gui_rpc_client.h
gui_rpc_client_ops.C
+
+David 14 Sept 2005
+ - The acct_mgr_rpc() GUI RPC now has a corresponding
+ acct_mgr_rpc_poll() GUI RPC.
+ The BOINC manager should use this
+ to find out when the RPC has finished,
+ and whether it succeeded.
+
+ NOTE: this eliminates the use of MSG_ALERT_ERROR and
+ MSG_ALERT_INFO message types.
+ We can take this code out of the Manager now.
+
+ client/
+ acct_mgr.C,h
+ gui_rpc_server_ops.C
+ lib/
+ gui_rpc_client.h
+ gui_rpc_client_ops.C
diff --git a/client/acct_mgr.C b/client/acct_mgr.C
index 83e04f61fd..d41bfa6591 100644
--- a/client/acct_mgr.C
+++ b/client/acct_mgr.C
@@ -38,17 +38,20 @@ int ACCT_MGR_OP::do_rpc(std::string url, std::string name, std::string password)
strcpy(buf, url.c_str());
+ error_num = ERR_IN_PROGRESS;
+
if (!strlen(buf) && strlen(gstate.acct_mgr_info.acct_mgr_url)) {
- msg_printf(NULL, MSG_ALERT_INFO, "Removing account manager info");
+ msg_printf(NULL, MSG_INFO, "Removing account manager info");
gstate.acct_mgr_info.clear();
boinc_delete_file(ACCT_MGR_URL_FILENAME);
boinc_delete_file(ACCT_MGR_LOGIN_FILENAME);
+ error_num = 0;
return 0;
}
canonicalize_master_url(buf);
if (!valid_master_url(buf)) {
- msg_printf(NULL, MSG_ALERT_ERROR, "Can't contact account manager:\n'%s' is not a valid URL", url.c_str());
+ error_num = ERR_INVALID_URL;
return 0;
}
strcpy(ami.acct_mgr_url, url.c_str());
@@ -59,10 +62,7 @@ int ACCT_MGR_OP::do_rpc(std::string url, std::string name, std::string password)
sprintf(buf, "%s?name=%s&password=%s", url.c_str(), name.c_str(), password.c_str());
retval = gstate.gui_http.do_rpc(this, buf, ACCT_MGR_REPLY_FILENAME);
if (retval) {
- msg_printf(NULL, MSG_ALERT_ERROR,
- "Can't contact account manager at '%s'.\nPlease check the URL and try again",
- url.c_str()
- );
+ error_num = retval;
return retval;
}
msg_printf(NULL, MSG_INFO, "Doing account manager RPC to %s", url.c_str());
@@ -118,22 +118,13 @@ void ACCT_MGR_OP::handle_reply(int http_op_retval) {
} else {
retval = ERR_FOPEN;
}
+ } else if (error_str.size()) {
+ retval = ERR_XML_PARSE; // ?? what should we use here ??
} else {
retval = http_op_retval;
}
- if (retval) {
- msg_printf(NULL, MSG_ALERT_ERROR,
- "Account manager update failed:\n%s", boincerror(retval)
- );
- return;
- }
-
- msg_printf(NULL, MSG_INFO, "Handling account manager RPC reply");
- if (error_str.size()) {
- msg_printf(NULL, MSG_ALERT_ERROR, "Account manager update failed:\n%s", error_str.c_str());
- return;
- }
- msg_printf(NULL, MSG_ALERT_INFO, "Account manager update succeeded.\nSee Messages for more info.");
+ error_num = retval;
+ if (retval) return;
gstate.acct_mgr_info = ami;
gstate.acct_mgr_info.write_info();
diff --git a/client/acct_mgr.h b/client/acct_mgr.h
index 89457c4fc3..c7b1c830d9 100644
--- a/client/acct_mgr.h
+++ b/client/acct_mgr.h
@@ -57,6 +57,7 @@ struct ACCOUNT {
};
struct ACCT_MGR_OP: public GUI_HTTP_OP {
+ int error_num;
ACCT_MGR_INFO ami;
// a temporary copy while doing RPC.
// CLIENT_STATE::acct_mgr_info is authoratative
@@ -67,7 +68,7 @@ struct ACCT_MGR_OP: public GUI_HTTP_OP {
virtual void handle_reply(int http_op_retval);
ACCT_MGR_OP(){}
- ~ACCT_MGR_OP(){}
+ virtual ~ACCT_MGR_OP(){}
};
#endif
diff --git a/client/gui_rpc_server_ops.C b/client/gui_rpc_server_ops.C
index 5dfbe90964..34c0b68a64 100644
--- a/client/gui_rpc_server_ops.C
+++ b/client/gui_rpc_server_ops.C
@@ -538,6 +538,31 @@ static void handle_network_available(char*, MIOFILE&) {
gstate.network_available();
}
+static void handle_acct_mgr_rpc_poll(char*, MIOFILE& fout) {
+ if (gstate.acct_mgr_op.error_num) {
+ fout.printf(
+ "
+
-Banners for BOINC projects from Anthony Hern: +
The 'B in a circle' icon was designed by Tim Lan. The Mac variant was contributed by Juho Viitasalo.
-Check out this imaginative -BOINC graphic -by high school student Jared Hatfield. +