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

tls_session: close transport after cleanup

The TlsSession object works as a state machine. Currently, when
shutdown() is called, the state is changed and the transport is
directly closed. This mean that the cleanup launched by the state
machine can be called after the transport is closed.

Change-Id: I2565259156073862d4eee1fc47003a8022de2126
parent f13f77ea
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
*
* Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com>
* Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
* Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -734,6 +735,8 @@ TlsSession::TlsSessionImpl::cleanup()
if (cookie_key_.data)
gnutls_free(cookie_key_.data);
transport_.shutdown();
}
TlsSessionState
......@@ -1268,7 +1271,6 @@ TlsSession::shutdown()
pimpl_->state_ = TlsSessionState::SHUTDOWN;
pimpl_->stateCondition_.notify_all();
pimpl_->rxCv_.notify_one(); // unblock waiting FSM
pimpl_->transport_.shutdown();
}
std::size_t
......
......@@ -3,6 +3,7 @@
*
* Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com>
* Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
* Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment