mirror of
https://github.com/espressif/openthread.git
synced 2026-08-15 07:07:46 +00:00
[dtls] fix bug in resetting dtls state on error (#3653)
This commit is contained in:
@@ -160,7 +160,7 @@ otError Dtls::Start(bool aClient,
|
||||
// do not handle new connection before guard time expired
|
||||
VerifyOrExit(mState == kStateStopped, rval = MBEDTLS_ERR_SSL_TIMEOUT);
|
||||
|
||||
mState = kStateConnecting;
|
||||
mState = kStateInitializing;
|
||||
|
||||
mbedtls_ssl_init(&mSsl);
|
||||
mbedtls_ssl_config_init(&mConf);
|
||||
@@ -258,10 +258,12 @@ otError Dtls::Start(bool aClient,
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
|
||||
mState = kStateConnecting;
|
||||
|
||||
Process();
|
||||
|
||||
exit:
|
||||
if ((mState == kStateConnecting) && (rval != 0))
|
||||
if ((mState == kStateInitializing) && (rval != 0))
|
||||
{
|
||||
mState = kStateStopped;
|
||||
FreeMbedtls();
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
enum State
|
||||
{
|
||||
kStateStopped = 0,
|
||||
kStateInitializing,
|
||||
kStateConnecting,
|
||||
kStateConnected,
|
||||
kStateCloseNotify,
|
||||
|
||||
Reference in New Issue
Block a user