Merge pull request #4684 from BOINC/dpa_version_check

Fix bug in new version check
This commit is contained in:
CharlieFenton 2022-03-30 02:35:09 -07:00 committed by Charlie Fenton
parent 43645e2e2b
commit 8e0f06ef2b
2 changed files with 21 additions and 8 deletions

View File

@ -320,13 +320,19 @@ void newer_version_startup_check() {
#define NEW_VERSION_CHECK_PERIOD (14*86400)
// get client version info from the BOINC server if we haven't done so recently.
// Called periodically from the main loop.
// Also called with force=true for the get_newer_version() GUI RPC
//
void CLIENT_STATE::new_version_check(bool force) {
if (force || (new_version_check_time == 0) ||
(now - new_version_check_time > NEW_VERSION_CHECK_PERIOD)) {
// get_current_version_op.handle_reply()
// updates new_version_check_time
//
get_current_version_op.do_rpc();
}
if (force
|| (new_version_check_time == 0)
|| (now - new_version_check_time > NEW_VERSION_CHECK_PERIOD)
) {
// get_current_version_op.handle_reply()
// updates new_version_check_time
//
get_current_version_op.do_rpc();
}
}

View File

@ -1089,7 +1089,14 @@ static void handle_acct_mgr_rpc_poll(GUI_RPC_CONN& grc) {
static void handle_get_newer_version(GUI_RPC_CONN& grc) {
gstate.new_version_check(true);
// this initiates an RPC to get version info.
// Wait for it to finish.
//
while (gstate.get_current_version_op.gui_http->gui_http_state != HTTP_STATE_IDLE) {
if (!gstate.poll_slow_events()) {
gstate.do_io_or_sleep(1.0);
}
}
grc.mfout.printf(
"<newer_version>%s</newer_version>\n"
"<download_url>%s</download_url>\n",