Commit 9b74a88f authored by Kishen Maloor's avatar Kishen Maloor

oc_tls:do not send duplicate close_notify for TLS

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent 118ac45e
Pipeline #126 passed with stage
in 49 seconds
......@@ -366,7 +366,9 @@ oc_tls_inactive(void *data)
return OC_EVENT_CONTINUE;
}
mbedtls_ssl_close_notify(&peer->ssl_ctx);
if ((peer->endpoint.flags & TCP) == 0) {
mbedtls_ssl_close_notify(&peer->ssl_ctx);
}
oc_tls_free_peer(peer, true);
}
OC_DBG("oc_tls: Terminating DTLS inactivity callback");
......@@ -1333,7 +1335,9 @@ oc_tls_close_connection(oc_endpoint_t *endpoint)
oc_tls_peer_t *peer = oc_tls_get_peer(endpoint);
if (peer) {
mbedtls_ssl_close_notify(&peer->ssl_ctx);
if ((peer->endpoint.flags & TCP) == 0) {
mbedtls_ssl_close_notify(&peer->ssl_ctx);
}
oc_tls_free_peer(peer, false);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment