Add ability to reconnect from server side (#7226)

* Add ability to reconnect from server side

* Fix code smell

Co-authored-by: Serhii Hadzhilov <serhii@symless.com>
This commit is contained in:
Serhii Hadzhilov
2022-10-03 17:08:24 +03:00
committed by GitHub
parent 82b3696b1b
commit 0f3e128e17
9 changed files with 104 additions and 59 deletions

View File

@ -403,17 +403,20 @@ SecureSocket::freeSSL()
// could cause events to get called on a dead object. TCPSocket
// will do this, too, but the double-call is harmless
setJob(NULL);
if (m_ssl->m_ssl != NULL) {
SSL_shutdown(m_ssl->m_ssl);
if (m_ssl) {
if (m_ssl->m_ssl != NULL) {
SSL_shutdown(m_ssl->m_ssl);
SSL_free(m_ssl->m_ssl);
m_ssl->m_ssl = NULL;
SSL_free(m_ssl->m_ssl);
m_ssl->m_ssl = NULL;
}
if (m_ssl->m_context != NULL) {
SSL_CTX_free(m_ssl->m_context);
m_ssl->m_context = NULL;
}
delete m_ssl;
m_ssl = nullptr;
}
if (m_ssl->m_context != NULL) {
SSL_CTX_free(m_ssl->m_context);
m_ssl->m_context = NULL;
}
delete m_ssl;
}
int