From 0476254e151c237d5ae28f854887d37eb2b2b1f7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 27 Aug 2011 18:32:47 +0000 Subject: [PATCH] - client: fix bug that caused project attach to fail - clientgui: Rom, we should do error-checking of most GUI RPCs; look for REPORT ERROR in ProjectProcessingPage.cpp svn path=/trunk/boinc/; revision=24059 --- checkin_notes | 11 ++++++++++ client/acct_setup.cpp | 12 +++++------ client/coproc_detect.cpp | 1 - clientgui/ProjectProcessingPage.cpp | 32 ++++++++++++++++------------- 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/checkin_notes b/checkin_notes index 2bb7db778b..c9330a2e3b 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5181,3 +5181,14 @@ David 26 Aug 2011 AccountManagerProcessingPage.cpp,h client/ client_types.cpp + +David 26 Aug 2011 + - client: fix bug that caused project attach to fail + - clientgui: Rom, we should do error-checking of most GUI RPCs; + look for REPORT ERROR in ProjectProcessingPage.cpp + + client/ + acct_setup.cpp + coproc_detect.cpp + clientgui/ + ProjectProcessingPage.cpp diff --git a/client/acct_setup.cpp b/client/acct_setup.cpp index ae5311a38f..b19909aebd 100644 --- a/client/acct_setup.cpp +++ b/client/acct_setup.cpp @@ -85,12 +85,12 @@ void ACCOUNT_IN::parse(XML_PARSER& xp) { user_name = ""; team_name = ""; - while (xp.get_tag()) { - if (xp.parse_string("", url)) continue; - if (xp.parse_string("", email_addr)) continue; - if (xp.parse_string("", passwd_hash)) continue; - if (xp.parse_string("", user_name)) continue; - if (xp.parse_string("", team_name)) continue; + while (!xp.get_tag()) { + if (xp.parse_string("url", url)) continue; + if (xp.parse_string("email_addr", email_addr)) continue; + if (xp.parse_string("passwd_hash", passwd_hash)) continue; + if (xp.parse_string("user_name", user_name)) continue; + if (xp.parse_string("team_name", team_name)) continue; } canonicalize_master_url(url); } diff --git a/client/coproc_detect.cpp b/client/coproc_detect.cpp index 3e13ad5f45..ab03b90d67 100644 --- a/client/coproc_detect.cpp +++ b/client/coproc_detect.cpp @@ -753,7 +753,6 @@ void COPROC_NVIDIA::get( #ifndef SIM NvAPI_Status nvapiStatus; - NvDisplayHandle hDisplay; NV_DISPLAY_DRIVER_VERSION Version; memset(&Version, 0, sizeof(Version)); Version.version = NV_DISPLAY_DRIVER_VERSION_VER; diff --git a/clientgui/ProjectProcessingPage.cpp b/clientgui/ProjectProcessingPage.cpp index f689b47f20..2cf870709a 100644 --- a/clientgui/ProjectProcessingPage.cpp +++ b/clientgui/ProjectProcessingPage.cpp @@ -357,7 +357,7 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE wxDateTime dtCurrentExecutionTime; wxTimeSpan tsExecutionTime; bool bPostNewEvent = true; - int iReturnValue = 0; + int retval = 0; bool creating_account = false; wxASSERT(pDoc); @@ -418,10 +418,10 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE dtStartExecutionTime = wxDateTime::Now(); dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; - iReturnValue = 0; + retval = 0; ao->error_num = ERR_RETRY; while ( - !iReturnValue && + !retval && ((ERR_IN_PROGRESS == ao->error_num) || (ERR_RETRY == ao->error_num)) && tsExecutionTime.GetSeconds() <= 60 && !CHECK_CLOSINGINPROGRESS() @@ -432,7 +432,7 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; - iReturnValue = pDoc->rpc.create_account_poll(*ao); + retval = pDoc->rpc.create_account_poll(*ao); IncrementProgress(m_pProgressIndicator); @@ -440,7 +440,7 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE ::wxSafeYield(GetParent()); } - if ((!iReturnValue) && !ao->error_num) { + if ((!retval) && !ao->error_num) { pWA->SetAccountCreatedSuccessfully(true); } } else { @@ -450,21 +450,24 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE dtStartExecutionTime = wxDateTime::Now(); dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; - iReturnValue = 0; + retval = 0; ao->error_num = ERR_RETRY; while ( - !iReturnValue && + !retval && ((ERR_IN_PROGRESS == ao->error_num) || (ERR_RETRY == ao->error_num)) && tsExecutionTime.GetSeconds() <= 60 && !CHECK_CLOSINGINPROGRESS() ) { if (ERR_RETRY == ao->error_num) { - pDoc->rpc.lookup_account(*ai); + retval = pDoc->rpc.lookup_account(*ai); + if (retval) { + // REPORT ERROR + } } dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; - iReturnValue = pDoc->rpc.lookup_account_poll(*ao); + retval = pDoc->rpc.lookup_account_poll(*ao); IncrementProgress(m_pProgressIndicator); @@ -473,7 +476,8 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE } } - if ((!iReturnValue) && !ao->error_num) { + + if ((!retval) && !ao->error_num) { SetProjectCommunicationsSucceeded(true); } else { SetProjectCommunicationsSucceeded(false); @@ -524,10 +528,10 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE dtStartExecutionTime = wxDateTime::Now(); dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; - iReturnValue = 0; + retval = 0; reply.error_num = ERR_RETRY; while ( - !iReturnValue && + !retval && ((ERR_IN_PROGRESS == reply.error_num) || (ERR_RETRY == reply.error_num)) && tsExecutionTime.GetSeconds() <= 60 && !CHECK_CLOSINGINPROGRESS() @@ -546,7 +550,7 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE dtCurrentExecutionTime = wxDateTime::Now(); tsExecutionTime = dtCurrentExecutionTime - dtStartExecutionTime; - iReturnValue = pDoc->rpc.project_attach_poll(reply); + retval = pDoc->rpc.project_attach_poll(reply); IncrementProgress(m_pProgressIndicator); @@ -554,7 +558,7 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE ::wxSafeYield(GetParent()); } - if (!iReturnValue && !reply.error_num) { + if (!retval && !reply.error_num) { SetProjectAttachSucceeded(true); pWA->SetAttachedToProjectSuccessfully(true); pWA->SetProjectURL(wxString(ai->url.c_str(), wxConvUTF8));