Skip to content

Commit

Permalink
Moved gnutls_bye() in thread
Browse files Browse the repository at this point in the history
  • Loading branch information
paullouisageneau committed May 19, 2020
1 parent 6a7296d commit 6302d99
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/dtlstransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ bool DtlsTransport::stop() {

PLOG_DEBUG << "Stopping DTLS recv thread";
mIncomingQueue.stop();
gnutls_bye(mSession, GNUTLS_SHUT_RDWR);
mRecvThread.join();
onRecv(nullptr);
return true;
}

Expand Down Expand Up @@ -218,6 +216,8 @@ void DtlsTransport::runRecvLoop() {
PLOG_ERROR << "DTLS recv: " << e.what();
}

gnutls_bye(mSession, GNUTLS_SHUT_RDWR);

PLOG_INFO << "DTLS disconnected";
changeState(State::Disconnected);
recv(nullptr);
Expand Down Expand Up @@ -429,7 +429,6 @@ bool DtlsTransport::stop() {
mIncomingQueue.stop();
mRecvThread.join();
SSL_shutdown(mSsl);
onRecv(nullptr);
return true;
}

Expand Down

0 comments on commit 6302d99

Please sign in to comment.