@@ -2478,7 +2478,7 @@ void LLVoiceWebRTCConnection::sendData(const std::string &data)
2478
2478
2479
2479
// Tell the simulator that we're shutting down a voice connection.
2480
2480
// The simulator will pass this on to the Secondlife WebRTC server.
2481
- void LLVoiceWebRTCConnection::breakVoiceConnectionCoro (connectionPtr_t connection)
2481
+ void LLVoiceWebRTCConnection::breakVoiceConnection (connectionPtr_t connection)
2482
2482
{
2483
2483
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE;
2484
2484
@@ -2493,15 +2493,18 @@ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro(connectionPtr_t connectio
2493
2493
if (!regionp || !regionp->capabilitiesReceived ())
2494
2494
{
2495
2495
LL_DEBUGS (" Voice" ) << " no capabilities for voice provisioning; waiting " << LL_ENDL;
2496
- connection->setVoiceConnectionState (VOICE_STATE_SESSION_RETRY);
2496
+ // fine, don't be polite and ask the janus server to break the connection.
2497
+ // just fall through and drop the connection.
2498
+ connection->setVoiceConnectionState (VOICE_STATE_SESSION_EXIT);
2497
2499
connection->mOutstandingRequests --;
2498
2500
return ;
2499
2501
}
2500
2502
2501
2503
std::string url = regionp->getCapability (" ProvisionVoiceAccountRequest" );
2502
2504
if (url.empty ())
2503
2505
{
2504
- connection->setVoiceConnectionState (VOICE_STATE_SESSION_RETRY);
2506
+ // and go on to drop the connection here, too.
2507
+ connection->setVoiceConnectionState (VOICE_STATE_SESSION_EXIT);
2505
2508
connection->mOutstandingRequests --;
2506
2509
return ;
2507
2510
}
@@ -2529,8 +2532,11 @@ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro(connectionPtr_t connectio
2529
2532
2530
2533
connection->mOutstandingRequests --;
2531
2534
2532
- if (connection->getVoiceConnectionState () == VOICE_STATE_WAIT_FOR_EXIT)
2535
+ if (connection->getVoiceConnectionState () == VOICE_STATE_WAIT_FOR_EXIT ||
2536
+ !(connection->getVoiceConnectionState () & VOICE_STATE_SESSION_STOPPING))
2533
2537
{
2538
+ // drop the connection if we either somehow got set back to a running/starting state
2539
+ // or we completed the call in the wait-for-exit state
2534
2540
connection->setVoiceConnectionState (VOICE_STATE_SESSION_EXIT);
2535
2541
}
2536
2542
}
@@ -2814,9 +2820,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
2814
2820
if (!LLWebRTCVoiceClient::isShuttingDown ())
2815
2821
{
2816
2822
mOutstandingRequests ++;
2817
- setVoiceConnectionState (VOICE_STATE_WAIT_FOR_EXIT);
2818
- LLCoros::instance ().launch (" LLVoiceWebRTCConnection::breakVoiceConnectionCoro" ,
2819
- boost::bind (&LLVoiceWebRTCConnection::breakVoiceConnectionCoro, this ->shared_from_this ()));
2823
+ breakVoiceConnection (this ->shared_from_this ());
2820
2824
}
2821
2825
else
2822
2826
{
@@ -2829,17 +2833,18 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
2829
2833
break ;
2830
2834
2831
2835
case VOICE_STATE_SESSION_EXIT:
2836
+ setVoiceConnectionState (VOICE_STATE_WAIT_FOR_CLOSE);
2837
+ mOutstandingRequests ++;
2838
+ if (!LLWebRTCVoiceClient::isShuttingDown ())
2832
2839
{
2833
- setVoiceConnectionState (VOICE_STATE_WAIT_FOR_CLOSE);
2834
- mOutstandingRequests ++;
2835
- if (!LLWebRTCVoiceClient::isShuttingDown ())
2836
- {
2837
- mWebRTCPeerConnectionInterface ->shutdownConnection ();
2838
- }
2839
- // else was already posted by llwebrtc::terminate().
2840
- break ;
2840
+ mWebRTCPeerConnectionInterface ->shutdownConnection ();
2841
+ }
2842
+ // else was already posted by llwebrtc::terminate().
2843
+ break ;
2844
+
2841
2845
case VOICE_STATE_WAIT_FOR_CLOSE:
2842
2846
break ;
2847
+
2843
2848
case VOICE_STATE_CLOSED:
2844
2849
if (!mShutDown )
2845
2850
{
@@ -2856,7 +2861,6 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
2856
2861
}
2857
2862
}
2858
2863
break ;
2859
- }
2860
2864
2861
2865
default :
2862
2866
{
0 commit comments