Skip to content
Snippets Groups Projects
Commit 9c26f7b5 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

tls_session: avoid to retry handshake if stopped

getting a TlsSession::shutdown() while doing a gnutls_handshake
provoke a loop (cause the handshake will return GNUTLS_E_INTERRUPTED
and will loop until HANDSHAKE_MAX_RETRY).

Change-Id: Ifabc24c815552a14781b72cb9baf66d987cb25ce
parent a944050e
Branches
No related tags found
No related merge requests found
...@@ -1161,7 +1161,8 @@ TlsSession::TlsSessionImpl::handleStateHandshake(TlsSessionState state) ...@@ -1161,7 +1161,8 @@ TlsSession::TlsSessionImpl::handleStateHandshake(TlsSessionState state)
JAMI_DBG("[TLS] handshake"); JAMI_DBG("[TLS] handshake");
ret = gnutls_handshake(session_); ret = gnutls_handshake(session_);
} while ((ret == GNUTLS_E_INTERRUPTED or ret == GNUTLS_E_AGAIN) } while ((ret == GNUTLS_E_INTERRUPTED or ret == GNUTLS_E_AGAIN)
and ++retry_count < HANDSHAKE_MAX_RETRY); and ++retry_count < HANDSHAKE_MAX_RETRY
and state_.load() != TlsSessionState::SHUTDOWN);
// Stop on fatal error // Stop on fatal error
if (gnutls_error_is_fatal(ret)) { if (gnutls_error_is_fatal(ret)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment