From 5d6142863ea14750d558d0209ac452e242347f53 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Sun, 14 Jun 2009 05:04:02 +0000 Subject: [PATCH] - MGR: Expand on Charlie's last checkin to include the rest of the polling RPCs in the wizard. The polling RPCs would return ERR_RETRY when the CC was in the middle of some other GUI_HTTP op (version check, project list download). clientgui/ AccountManagerProcessingPage.cpp AccountManagerPropertiesPage.cpp ProjectProcessingPage.cpp ProjectPropertiesPage.cpp svn path=/trunk/boinc/; revision=18410 --- checkin_notes | 12 +++++ clientgui/AccountManagerProcessingPage.cpp | 17 ++----- clientgui/AccountManagerPropertiesPage.cpp | 22 ++++---- clientgui/ProjectProcessingPage.cpp | 59 +++++++++++++--------- clientgui/ProjectPropertiesPage.cpp | 22 ++++---- 5 files changed, 79 insertions(+), 53 deletions(-) diff --git a/checkin_notes b/checkin_notes index 9ae6df1680..cb77d95da9 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5626,3 +5626,15 @@ Rom 13 June 2009 browser.cpp lib/ miofile.cpp, .h + +Rom 13 June 2009 + - MGR: Expand on Charlie's last checkin to include the rest of the polling + RPCs in the wizard. The polling RPCs would return ERR_RETRY when + the CC was in the middle of some other GUI_HTTP op (version check, + project list download). + + clientgui/ + AccountManagerProcessingPage.cpp + AccountManagerPropertiesPage.cpp + ProjectProcessingPage.cpp + ProjectPropertiesPage.cpp diff --git a/clientgui/AccountManagerProcessingPage.cpp b/clientgui/AccountManagerProcessingPage.cpp index 782a571217..9e15d159d6 100644 --- a/clientgui/AccountManagerProcessingPage.cpp +++ b/clientgui/AccountManagerProcessingPage.cpp @@ -269,26 +269,19 @@ void CAccountManagerProcessingPage::OnStateChange( CAccountManagerProcessingPage username = (const char*)pWAP->m_AccountInfoPage->GetAccountEmailAddress().mb_str(); password = (const char*)pWAP->m_AccountInfoPage->GetAccountPassword().mb_str(); - pDoc->rpc.acct_mgr_rpc( - url.c_str(), - username.c_str(), - password.c_str(), - pWAP->m_bCredentialsCached - ); // Wait until we are done processing the request. dtStartExecutionTime = wxDateTime::Now(); dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; iReturnValue = 0; - reply.error_num = ERR_IN_PROGRESS; - while (!iReturnValue && - ((ERR_IN_PROGRESS == reply.error_num) || - (ERR_RETRY == reply.error_num)) && + reply.error_num = ERR_RETRY; + while ( + !iReturnValue && + ((ERR_IN_PROGRESS == reply.error_num) || (ERR_RETRY == reply.error_num)) && (tsExecutionTime.GetSeconds() <= 60) && !CHECK_CLOSINGINPROGRESS() - ) - { + ) { if (ERR_RETRY == reply.error_num) { pDoc->rpc.acct_mgr_rpc( url.c_str(), diff --git a/clientgui/AccountManagerPropertiesPage.cpp b/clientgui/AccountManagerPropertiesPage.cpp index 998f7a2370..6ee396d591 100644 --- a/clientgui/AccountManagerPropertiesPage.cpp +++ b/clientgui/AccountManagerPropertiesPage.cpp @@ -261,9 +261,6 @@ void CAccountManagerPropertiesPage::OnStateChange( CAccountManagerPropertiesPage break; case ACCTMGRPROP_RETRPROJECTPROPERTIES_EXECUTE: // Attempt to retrieve the project's account creation policies - pDoc->rpc.get_project_config( - (const char*)pWAP->m_AccountManagerInfoPage->GetProjectURL().mb_str() - ); // Wait until we are done processing the request. dtStartExecutionTime = wxDateTime::Now(); @@ -271,12 +268,19 @@ void CAccountManagerPropertiesPage::OnStateChange( CAccountManagerPropertiesPage tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; iReturnValue = 0; pc->clear(); - pc->error_num = ERR_IN_PROGRESS; - while ((!iReturnValue && (ERR_IN_PROGRESS == pc->error_num)) && - tsExecutionTime.GetSeconds() <= 60 && - !CHECK_CLOSINGINPROGRESS() - ) - { + pc->error_num = ERR_RETRY; + while ( + !iReturnValue && + ((ERR_IN_PROGRESS == pc->error_num) || (ERR_RETRY == pc->error_num)) && + tsExecutionTime.GetSeconds() <= 60 && + !CHECK_CLOSINGINPROGRESS() + ) { + if (ERR_RETRY == pc->error_num) { + pDoc->rpc.get_project_config( + (const char*)pWAP->m_AccountManagerInfoPage->GetProjectURL().mb_str() + ); + } + dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; iReturnValue = pDoc->rpc.get_project_config_poll(*pc); diff --git a/clientgui/ProjectProcessingPage.cpp b/clientgui/ProjectProcessingPage.cpp index e198df76e0..1abe3dc9a7 100644 --- a/clientgui/ProjectProcessingPage.cpp +++ b/clientgui/ProjectProcessingPage.cpp @@ -408,20 +408,24 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE } if (pWAP->m_AccountInfoPage->m_pAccountCreateCtrl->GetValue()) { - pDoc->rpc.create_account(*ai); creating_account = true; // Wait until we are done processing the request. dtStartExecutionTime = wxDateTime::Now(); dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; - ao->error_num = ERR_IN_PROGRESS; + iReturnValue = 0; + ao->error_num = ERR_RETRY; while ( - ERR_IN_PROGRESS == ao->error_num && !iReturnValue && + !iReturnValue && + ((ERR_IN_PROGRESS == ao->error_num) || (ERR_RETRY == ao->error_num)) && tsExecutionTime.GetSeconds() <= 60 && !CHECK_CLOSINGINPROGRESS() - ) - { + ) { + if (ERR_RETRY == reply.error_num) { + pDoc->rpc.create_account(*ai); + } + dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; iReturnValue = pDoc->rpc.create_account_poll(*ao); @@ -436,19 +440,24 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE pWAP->SetAccountCreatedSuccessfully(true); } } else { - pDoc->rpc.lookup_account(*ai); + creating_account = false; // Wait until we are done processing the request. dtStartExecutionTime = wxDateTime::Now(); dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; - ao->error_num = ERR_IN_PROGRESS; + iReturnValue = 0; + ao->error_num = ERR_RETRY; while ( - ERR_IN_PROGRESS == ao->error_num && !iReturnValue && + !iReturnValue && + ((ERR_IN_PROGRESS == ao->error_num) || (ERR_RETRY == ao->error_num)) && tsExecutionTime.GetSeconds() <= 60 && !CHECK_CLOSINGINPROGRESS() - ) - { + ) { + if (ERR_RETRY == reply.error_num) { + pDoc->rpc.lookup_account(*ai); + } + dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; iReturnValue = pDoc->rpc.lookup_account_poll(*ao); @@ -507,27 +516,31 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE break; case ATTACHPROJECT_ATTACHPROJECT_EXECUTE: if (GetProjectCommunitcationsSucceeded()) { - if (pWAP->m_bCredentialsCached) { - pDoc->rpc.project_attach_from_file(); - } else { - pDoc->rpc.project_attach( - ai->url.c_str(), - ao->authenticator.c_str(), - pWAP->project_config.name.c_str() - ); - } // Wait until we are done processing the request. dtStartExecutionTime = wxDateTime::Now(); dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; iReturnValue = 0; - reply.error_num = ERR_IN_PROGRESS; - while ((!iReturnValue && (ERR_IN_PROGRESS == reply.error_num)) && + reply.error_num = ERR_RETRY; + while ( + !iReturnValue && + ((ERR_IN_PROGRESS == reply.error_num) || (ERR_RETRY == reply.error_num)) && tsExecutionTime.GetSeconds() <= 60 && !CHECK_CLOSINGINPROGRESS() - ) - { + ) { + if (ERR_RETRY == reply.error_num) { + if (pWAP->m_bCredentialsCached) { + pDoc->rpc.project_attach_from_file(); + } else { + pDoc->rpc.project_attach( + ai->url.c_str(), + ao->authenticator.c_str(), + pWAP->project_config.name.c_str() + ); + } + } + dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; iReturnValue = pDoc->rpc.project_attach_poll(reply); diff --git a/clientgui/ProjectPropertiesPage.cpp b/clientgui/ProjectPropertiesPage.cpp index 4d7eb600be..cbe52004b5 100644 --- a/clientgui/ProjectPropertiesPage.cpp +++ b/clientgui/ProjectPropertiesPage.cpp @@ -386,9 +386,6 @@ void CProjectPropertiesPage::OnStateChange( CProjectPropertiesPageEvent& WXUNUSE break; case PROJPROP_RETRPROJECTPROPERTIES_EXECUTE: // Attempt to retrieve the project's account creation policies - pDoc->rpc.get_project_config( - (const char*)pWAP->m_ProjectInfoPage->GetProjectURL().mb_str() - ); // Wait until we are done processing the request. dtStartExecutionTime = wxDateTime::Now(); @@ -396,12 +393,19 @@ void CProjectPropertiesPage::OnStateChange( CProjectPropertiesPageEvent& WXUNUSE tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; iReturnValue = 0; pc->clear(); - pc->error_num = ERR_IN_PROGRESS; - while ((!iReturnValue && (ERR_IN_PROGRESS == pc->error_num)) && - tsExecutionTime.GetSeconds() <= 60 && - !CHECK_CLOSINGINPROGRESS() - ) - { + pc->error_num = ERR_RETRY; + while ( + !iReturnValue && + ((ERR_IN_PROGRESS == pc->error_num) || (ERR_RETRY == pc->error_num)) && + tsExecutionTime.GetSeconds() <= 60 && + !CHECK_CLOSINGINPROGRESS() + ) { + if (ERR_RETRY == pc->error_num) { + pDoc->rpc.get_project_config( + (const char*)pWAP->m_ProjectInfoPage->GetProjectURL().mb_str() + ); + } + dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; iReturnValue = pDoc->rpc.get_project_config_poll(*pc);