Skip to content
Snippets Groups Projects
Unverified Commit 61196f55 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

tls session: use newState and call onStateChange's callback

Change-Id: I7fb16f21046eaf4bb6aa88a3af3d97da4c0a4e08
parent 553a2978
Branches
No related tags found
No related merge requests found
......@@ -490,8 +490,8 @@ private:
*peerCertificate_);
tls_ep_->setOnStateChange([this, ice=std::move(ice)] (tls::TlsSessionState state) {
if (state == tls::TlsSessionState::SHUTDOWN) {
JAMI_WARN() << "TLS connection failure from peer "
<< peer_.toString();
if (!connected_)
JAMI_WARN() << "TLS connection failure from peer " << peer_.toString();
ice->cancelOperations(); // This will stop current PeerChannel operations
cancel();
} else if (state == tls::TlsSessionState::ESTABLISHED) {
......
......@@ -316,7 +316,7 @@ TlsSession::TlsSessionImpl::TlsSessionImpl(std::unique_ptr<SocketType>&& transpo
TlsSession::TlsSessionImpl::~TlsSessionImpl()
{
state_ = TlsSessionState::SHUTDOWN;
newState_ = TlsSessionState::SHUTDOWN;
stateCondition_.notify_all();
rxCv_.notify_all();
thread_.join();
......@@ -1305,7 +1305,7 @@ TlsSession::currentCipherSuiteId(std::array<uint8_t, 2>& cs_id) const
void
TlsSession::shutdown()
{
pimpl_->state_ = TlsSessionState::SHUTDOWN;
pimpl_->newState_ = TlsSessionState::SHUTDOWN;
pimpl_->stateCondition_.notify_all();
pimpl_->rxCv_.notify_one(); // unblock waiting FSM
}
......
......@@ -214,7 +214,6 @@ SipTransportBroker::transportStateChanged(pjsip_transport* tp,
std::lock_guard<std::mutex> lock(transportMapMutex_);
auto key = transports_.find(tp);
if (key == transports_.end()) {
JAMI_WARN("spurious pjsip transport state change");
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment