diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2020-05-27 10:39:20 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2020-05-27 10:39:20 -0400 |
commit | a0356e977d15dd30878f80f5a097b07dd67d3bcd (patch) | |
tree | a3aa2793ac142edf0b5e89848b5e8ea99156f948 | |
parent | 294fb30a3cd84145fa02e1292c773b2a28e6be97 (diff) |
DRTVWR-476: Make LLVivoxVoiceClient::logoutOfVivox() wait for logout.
It can happen that we arrive at logoutOfVivox() with some other message
queued on the LLEventMailDrop in question. If logoutOfVivox() assumes that
other message is logout and exits, then subsequent code gets confused.
Introduce a loop to wait (with the existing timeout) for the real logout
message.
-rw-r--r-- | indra/newview/llvoicevivox.cpp | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 5d0b3e5dd6..27cc19072f 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -338,15 +338,15 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mPlayRequestCount(0), mAvatarNameCacheConnection(), - mIsInTuningMode(false), - mIsInChannel(false), - mIsJoiningSession(false), - mIsWaitingForFonts(false), - mIsLoggingIn(false), - mIsLoggedIn(false), - mIsProcessingChannels(false), - mIsCoroutineActive(false), - mVivoxPump("vivoxClientPump") + mIsInTuningMode(false), + mIsInChannel(false), + mIsJoiningSession(false), + mIsWaitingForFonts(false), + mIsLoggingIn(false), + mIsLoggedIn(false), + mIsProcessingChannels(false), + mIsCoroutineActive(false), + mVivoxPump("vivoxClientPump") { mSpeakerVolume = scale_speaker_volume(0); @@ -1255,15 +1255,22 @@ void LLVivoxVoiceClient::logoutOfVivox(bool wait) if (wait) { LLSD timeoutResult(LLSDMap("logout", "timeout")); + LLSD result; - LL_DEBUGS("Voice") - << "waiting for logout response on " - << mVivoxPump.getName() - << LL_ENDL; - - LLSD result = llcoro::suspendUntilEventOnWithTimeout(mVivoxPump, LOGOUT_ATTEMPT_TIMEOUT, timeoutResult); - - LL_DEBUGS("Voice") << "event=" << ll_stream_notation_sd(result) << LL_ENDL; + do + { + LL_DEBUGS("Voice") + << "waiting for logout response on " + << mVivoxPump.getName() + << LL_ENDL; + + result = llcoro::suspendUntilEventOnWithTimeout(mVivoxPump, LOGOUT_ATTEMPT_TIMEOUT, timeoutResult); + + LL_DEBUGS("Voice") << "event=" << ll_stream_notation_sd(result) << LL_ENDL; + // Don't get confused by prior queued events -- note that it's + // very important that mVivoxPump is an LLEventMailDrop, which + // does queue events. + } while (! result["logout"]); } else { |