diff --git a/checkin_notes b/checkin_notes index b0177ef98b..a855fab312 100755 --- a/checkin_notes +++ b/checkin_notes @@ -10499,3 +10499,25 @@ Rom 12 Aug 2005 BOINCGUI.pjd ValidateURL.cpp, .h WizAttachProject.cpp, .h + +David 12 Aug 2005 + - Added project_attach_poll() GUI RPC. + - removed MSG_ALERT messages on attach succeed/fail + - added class PROJECT_ATTACH in core client. + Its error_num field stores result of last attach + - attach failure reasons now have ERR_* values + + client/ + acct_mgr.C + acct_setup.h + client_state.h + client_types.h + cs_account.C + cs_cmdline.C + gui_rpc_server_ops.C + scheduler_op.C + lib/ + error_numbers.h + gui_rpc_client.h + gui_rpc_client_ops.C + util.C diff --git a/client/acct_mgr.C b/client/acct_mgr.C index 2d872a8add..83e04f61fd 100644 --- a/client/acct_mgr.C +++ b/client/acct_mgr.C @@ -151,7 +151,7 @@ void ACCT_MGR_OP::handle_reply(int http_op_retval) { } } else { msg_printf(NULL, MSG_INFO, "Attaching to %s", acct.url.c_str()); - gstate.add_project(acct.url.c_str(), acct.authenticator.c_str(), false); + gstate.add_project(acct.url.c_str(), acct.authenticator.c_str()); } } if (accounts.size() == 0) { diff --git a/client/acct_setup.h b/client/acct_setup.h index c251f957a2..1cb6c1bb25 100644 --- a/client/acct_setup.h +++ b/client/acct_setup.h @@ -71,4 +71,8 @@ struct LOOKUP_WEBSITE_OP: public GUI_HTTP_OP { LOOKUP_WEBSITE_OP(){error_num = BOINC_SUCCESS;} }; +struct PROJECT_ATTACH { + int error_num; +}; + #endif diff --git a/client/client_state.h b/client/client_state.h index 1c00b8dc92..a3ca231548 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -107,6 +107,7 @@ public: LOOKUP_ACCOUNT_OP lookup_account_op; CREATE_ACCOUNT_OP create_account_op; LOOKUP_WEBSITE_OP lookup_website_op; + PROJECT_ATTACH project_attach; int core_client_major_version; int core_client_minor_version; @@ -227,7 +228,7 @@ private: // --------------- cs_account.C: public: - int add_project(const char* master_url, const char* authenticator, bool show_alrts); + int add_project(const char* master_url, const char* authenticator); private: int parse_account_files(); int parse_preferences_for_user_files(); diff --git a/client/client_types.h b/client/client_types.h index fffbed078d..96b1c1c34d 100644 --- a/client/client_types.h +++ b/client/client_types.h @@ -144,13 +144,6 @@ struct DAILY_STATS { int parse(FILE*); }; -// reasons for attach failure -#define ATTACH_FAIL_INIT 1 -#define ATTACH_FAIL_DOWNLOAD 2 -#define ATTACH_FAIL_PARSE 3 -#define ATTACH_FAIL_BAD_KEY 4 -#define ATTACH_FAIL_FILE_WRITE 5 - class PROJECT { public: // the following items come from the account file @@ -216,8 +209,6 @@ public: // need to fetch and parse the master URL bool sched_rpc_pending; // contact scheduling server for preferences bool tentative; // master URL and account ID not confirmed - bool show_alerts; // show alerts on project attach fail - // (used for attach via GUI) bool anonymous_platform; // app_versions.xml file found in project dir; // use those apps rather then getting from server bool non_cpu_intensive; diff --git a/client/cs_account.C b/client/cs_account.C index ac66a16527..e556880cd1 100644 --- a/client/cs_account.C +++ b/client/cs_account.C @@ -347,9 +347,7 @@ int PROJECT::write_statistics_file() { return 0; } -int CLIENT_STATE::add_project( - const char* master_url, const char* _auth, bool show_alerts -) { +int CLIENT_STATE::add_project(const char* master_url, const char* _auth) { char path[256], canonical_master_url[256], auth[256]; PROJECT* project; FILE* f; @@ -359,14 +357,7 @@ int CLIENT_STATE::add_project( strip_whitespace(canonical_master_url); canonicalize_master_url(canonical_master_url); if (!valid_master_url(canonical_master_url)) { - msg_printf(0, MSG_ERROR, "Invalid project URL: %s", canonical_master_url); - if (show_alerts) { - msg_printf(0, MSG_ALERT_ERROR, - "%s is not a valid URL.\n" - "You may have typed the URL incorrectly.\n", - canonical_master_url - ); - } + msg_printf(0, MSG_ERROR, "Invalid URL: %s", canonical_master_url); return ERR_INVALID_URL; } @@ -374,13 +365,6 @@ int CLIENT_STATE::add_project( strip_whitespace(auth); if (!strlen(auth)) { msg_printf(0, MSG_ERROR, "Missing account key"); - if (show_alerts) { - msg_printf(0, MSG_ALERT_ERROR, - "Missing account key.\n" - "Visit the project's web site\n" - "to get your account key." - ); - } return ERR_AUTHENTICATOR; } @@ -388,11 +372,6 @@ int CLIENT_STATE::add_project( // if (lookup_project(canonical_master_url)) { msg_printf(0, MSG_ERROR, "Already attached to %s", canonical_master_url); - if (show_alerts) { - msg_printf(0, MSG_ALERT_INFO, - "Already attached to %s", canonical_master_url - ); - } return ERR_ALREADY_ATTACHED; } @@ -403,7 +382,6 @@ int CLIENT_STATE::add_project( strcpy(project->authenticator, auth); project->tentative = true; - project->show_alerts = show_alerts; retval = project->write_account_file(); if (retval) return retval; @@ -428,42 +406,42 @@ int CLIENT_STATE::add_project( // called when the client fails to attach to a project // -void PROJECT::attach_failed(int reason) { - int msg_type = show_alerts?MSG_ALERT_ERROR:MSG_ERROR; - switch(reason){ - case ATTACH_FAIL_INIT: - msg_printf(this, msg_type, +void PROJECT::attach_failed(int error_num) { + gstate.project_attach.error_num = error_num; + switch(error_num){ + case ERR_ATTACH_FAIL_INIT: + msg_printf(this, MSG_ERROR, "Couldn't connect to URL %s.\n" "Please check URL.", master_url ); break; - case ATTACH_FAIL_DOWNLOAD: - msg_printf(this, msg_type, + case ERR_ATTACH_FAIL_DOWNLOAD: + msg_printf(this, MSG_ERROR, "Couldn't access URL %s.\n" "The project's servers may be down,\n" "in which case please try again later.", master_url ); break; - case ATTACH_FAIL_PARSE: - msg_printf(this, msg_type, + case ERR_ATTACH_FAIL_PARSE: + msg_printf(this, MSG_ERROR, "The page at %s contains no BOINC information.\n" "It may not be the URL of a BOINC project.\n" "Please check the URL and try again.", master_url ); break; - case ATTACH_FAIL_BAD_KEY: - msg_printf(this, msg_type, + case ERR_ATTACH_FAIL_BAD_KEY: + msg_printf(this, MSG_ERROR, "The account key you provided for %s\n" "was not recognized as a valid account key.\n" "Please check the account key and try again.", master_url ); break; - case ATTACH_FAIL_FILE_WRITE: - msg_printf(this, msg_type, + case ERR_ATTACH_FAIL_FILE_WRITE: + msg_printf(this, MSG_ERROR, "BOINC was unable to create an account file for %s on your disk.\n" "Please check file system permissions and try again.\n", master_url diff --git a/client/cs_cmdline.C b/client/cs_cmdline.C index 7c32cd37db..c89f7e8e6b 100644 --- a/client/cs_cmdline.C +++ b/client/cs_cmdline.C @@ -276,7 +276,7 @@ void CLIENT_STATE::do_cmdline_actions() { } if (strlen(attach_project_url)) { - add_project(attach_project_url, attach_project_auth, false); + add_project(attach_project_url, attach_project_auth); } } diff --git a/client/gui_rpc_server_ops.C b/client/gui_rpc_server_ops.C index c38e7bc0b8..8677749afc 100644 --- a/client/gui_rpc_server_ops.C +++ b/client/gui_rpc_server_ops.C @@ -200,7 +200,8 @@ static void handle_project_attach(char* buf, MIOFILE& fout) { fout.printf("Missing authenticator\n"); return; } - gstate.add_project(url.c_str(), authenticator.c_str(), true); + gstate.add_project(url.c_str(), authenticator.c_str()); + gstate.project_attach.error_num = ERR_IN_PROGRESS; fout.printf("\n"); } @@ -577,9 +578,19 @@ static void handle_lookup_website(char* buf, MIOFILE& fout) { } static void handle_lookup_website_poll(char*, MIOFILE& fout) { - fout.printf("\n"); - fout.printf(" %d\n", gstate.lookup_website_op.error_num); - fout.printf("\n"); + fout.printf( + "\n" + " %d\n" + "\n", + gstate.lookup_website_op.error_num + ); +} + +static void handle_project_attach_poll(char*, MIOFILE& fout) { + fout.printf( + "%d\n", + gstate.project_attach.error_num + ); } int GUI_RPC_CONN::handle_rpc() { @@ -719,10 +730,12 @@ int GUI_RPC_CONN::handle_rpc() { handle_create_account(request_msg, mf); } else if (match_tag(request_msg, "unrecognized op\n"); } diff --git a/client/scheduler_op.C b/client/scheduler_op.C index 3404dd080e..8b92c090bf 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -63,7 +63,7 @@ bool SCHEDULER_OP::check_master_fetch_start() { "Couldn't start master page download: %s", boincerror(retval) ); if (p->tentative) { - p->attach_failed(ATTACH_FAIL_INIT); + p->attach_failed(ERR_ATTACH_FAIL_INIT); } else { p->master_fetch_failures++; backoff(p, "Master page fetch failed\n"); @@ -183,7 +183,7 @@ void SCHEDULER_OP::backoff(PROJECT* p, const char *error_msg ) { msg_printf(p, MSG_ERROR, error_msg); if (p->tentative) { - p->attach_failed(ATTACH_FAIL_INIT); + p->attach_failed(ERR_ATTACH_FAIL_INIT); return; } @@ -388,7 +388,7 @@ bool SCHEDULER_OP::poll() { if (cur_proj->tentative) { PROJECT* project_temp = cur_proj; cur_proj = 0; // keep detach(0) from removing HTTP OP - project_temp->attach_failed(ATTACH_FAIL_PARSE); + project_temp->attach_failed(ERR_ATTACH_FAIL_PARSE); err = true; } else { cur_proj->master_fetch_failures++; @@ -414,7 +414,7 @@ bool SCHEDULER_OP::poll() { if (cur_proj->tentative) { PROJECT* project_temp = cur_proj; cur_proj = 0; - project_temp->attach_failed(ATTACH_FAIL_DOWNLOAD); + project_temp->attach_failed(ERR_ATTACH_FAIL_DOWNLOAD); } else { cur_proj->master_fetch_failures++; backoff(cur_proj, "Master file fetch failed\n"); @@ -469,15 +469,17 @@ bool SCHEDULER_OP::poll() { // if (cur_proj->tentative) { if (retval || strlen(cur_proj->user_name)==0) { - cur_proj->attach_failed(ATTACH_FAIL_BAD_KEY); + cur_proj->attach_failed(ERR_ATTACH_FAIL_BAD_KEY); } else { cur_proj->tentative = false; retval = cur_proj->write_account_file(); if (retval) { - cur_proj->attach_failed(ATTACH_FAIL_FILE_WRITE); - } else if (cur_proj->show_alerts) { - msg_printf(cur_proj, MSG_ALERT_INFO, - "Successfully attached to %s", cur_proj->get_project_name() + cur_proj->attach_failed(ERR_ATTACH_FAIL_FILE_WRITE); + } else { + gstate.project_attach.error_num = 0; + msg_printf(cur_proj, MSG_INFO, + "Successfully attached to %s", + cur_proj->get_project_name() ); } } diff --git a/doc/boinc_news.inc b/doc/boinc_news.inc index 470d058f10..ac22465749 100644 --- a/doc/boinc_news.inc +++ b/doc/boinc_news.inc @@ -2,6 +2,12 @@ $project_news = array( +array("August 9, 2005", + "BOINC is transitioning to use libcurl + for HTTP operations. + This will allow BOINC to use HTTPS (secure HTTP) + for scheduler requests and file transfers." +), array("August 3, 2005", "Non-open-source code (RSAEuro and GLUT) has been removed from BOINC. OpenSSL's crypto library is used for encryption." diff --git a/doc/files.php b/doc/files.php index 7a922a3f11..fa434417c5 100644 --- a/doc/files.php +++ b/doc/files.php @@ -71,7 +71,7 @@ list_item("executable", ); list_item("upload_when_present", "If present, indicates that the file should be uploaded - when the application that generates it exits. + when the application finishes. "); list_item("sticky", "If present, indicates that the file should be retained diff --git a/doc/index.php b/doc/index.php index bcafe20b1f..1820371cfd 100644 --- a/doc/index.php +++ b/doc/index.php @@ -60,11 +60,12 @@ computer resources
2) Download and run BOINC software.

- You can participate in any or all projects -- the choice is up to you. - You control the percentage of your computing power + You can participate in any or all projects, + and you control the percentage of your computing power that goes to each project. - If you participate in several projects, - your computer will be busy even when one project has no work. + By participating in several projects, + you ensure that your computer will be kept busy + even when one project has no work.

... more diff --git a/lib/error_numbers.h b/lib/error_numbers.h index ee243e7f84..de038acc82 100755 --- a/lib/error_numbers.h +++ b/lib/error_numbers.h @@ -156,6 +156,12 @@ #define ERR_BAD_PASSWD -206 #define ERR_NONUNIQUE_EMAIL -207 #define ERR_ACCT_CREATION_DISABLED -208 +#define ERR_ATTACH_FAIL_INIT -209 +#define ERR_ATTACH_FAIL_DOWNLOAD -210 +#define ERR_ATTACH_FAIL_PARSE -211 +#define ERR_ATTACH_FAIL_BAD_KEY -212 +#define ERR_ATTACH_FAIL_FILE_WRITE -213 + // PLEASE: add a text description of your error to // the text description function boincerror() in util.C. diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index 7fb93adb51..c1a0842b46 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -564,6 +564,7 @@ public: int create_account_poll(ACCOUNT_OUT&); int lookup_website(int); int lookup_website_poll(); + int project_attach_poll(); }; struct RPC { diff --git a/lib/gui_rpc_client_ops.C b/lib/gui_rpc_client_ops.C index b487afee41..fc3c5fec10 100644 --- a/lib/gui_rpc_client_ops.C +++ b/lib/gui_rpc_client_ops.C @@ -1570,3 +1570,16 @@ int RPC_CLIENT::lookup_website_poll() { return lw.parse(rpc.fin); } +int RPC_CLIENT::project_attach_poll() { + RPC rpc(this); + char buf[256]; + int retval; + + retval = rpc.do_rpc("\n"); + if (retval) return retval; + retval = ERR_XML_PARSE; + if (rpc.fin.fgets(buf, 256)) { + parse_int(buf, "", retval); + } + return retval; +} diff --git a/lib/util.C b/lib/util.C index a52d640f79..9d2f99c10a 100755 --- a/lib/util.C +++ b/lib/util.C @@ -954,6 +954,11 @@ const char* boincerror(int which_error) { case ERR_USER_PERMISSION: return "user permission"; case ERR_SHMEM_NAME: return "can't get shared mem segment name"; case ERR_NO_NETWORK_CONNECTION: return "no available network connection"; + case ERR_ATTACH_FAIL_INIT: return "Couldn't start master page download"; + case ERR_ATTACH_FAIL_DOWNLOAD: return "Couldn't download master page"; + case ERR_ATTACH_FAIL_PARSE: return "Couldn't parse master page"; + case ERR_ATTACH_FAIL_BAD_KEY: return "Invalid account key"; + case ERR_ATTACH_FAIL_FILE_WRITE: return "Couldn't write account file"; } static char buf[64]; sprintf(buf, "error %d", which_error);