mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-09 09:35:32 -04:00
improved the login in the interaction between terminal api client and main
This commit is contained in:
parent
7ee527ecbd
commit
decbd3514d
5 changed files with 148 additions and 92 deletions
|
@ -150,24 +150,29 @@ void RsControlModule::run()
|
|||
}
|
||||
|
||||
// skip account selection if autologin is available
|
||||
if(initResult != RS_INIT_HAVE_ACCOUNT)
|
||||
setRunState(WAITING_ACCOUNT_SELECT);
|
||||
bool wait_for_account_select = (initResult != RS_INIT_HAVE_ACCOUNT);
|
||||
|
||||
// wait for login request
|
||||
bool auto_login = false;
|
||||
bool wait_for_account_select = (initResult != RS_INIT_HAVE_ACCOUNT);
|
||||
|
||||
if(wait_for_account_select)
|
||||
setRunState(WAITING_ACCOUNT_SELECT);
|
||||
|
||||
while(wait_for_account_select && !processShouldExit())
|
||||
{
|
||||
usleep(5*1000);
|
||||
usleep(500*1000);
|
||||
RsStackMutex stack(mDataMtx); // ********** LOCKED **********
|
||||
wait_for_account_select = mLoadPeerId.isNull();
|
||||
|
||||
if(!mLoadPeerId.isNull())
|
||||
wait_for_account_select = wait_for_account_select && !RsAccounts::SelectAccount(mLoadPeerId);
|
||||
|
||||
auto_login = mAutoLoginNextTime;
|
||||
if(!wait_for_account_select)
|
||||
{
|
||||
wait_for_account_select = !RsAccounts::SelectAccount(mLoadPeerId);
|
||||
if(wait_for_account_select)
|
||||
setRunState(WAITING_ACCOUNT_SELECT);
|
||||
}
|
||||
|
||||
//if(!wait_for_account_select)
|
||||
//{
|
||||
// if(wait_for_account_select)
|
||||
// setRunState(WAITING_ACCOUNT_SELECT);
|
||||
//}
|
||||
}
|
||||
|
||||
if(processShouldExit())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue