From 4e3b8ed2b51f83cd2b2ead5602b4f00a28feee87 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 18 Nov 2020 17:16:50 +0000 Subject: [PATCH] Fix cherry picked commit. --- lib/net_mosq.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/lib/net_mosq.c b/lib/net_mosq.c index 26a1eb3b..dc305bed 100644 --- a/lib/net_mosq.c +++ b/lib/net_mosq.c @@ -855,16 +855,6 @@ static int net__init_ssl_ctx(struct mosquitto *mosq) #endif -void net__socket_close_compat(struct mosquitto *mosq) -{ -#ifdef WITH_BROKER - struct mosquitto_db *db = mosquitto__get_db(); - net__socket_close(db, mosq); -#else - net__socket_close(mosq); -#endif -} - int net__socket_connect_step3(struct mosquitto *mosq, const char *host) { #ifdef WITH_TLS @@ -872,7 +862,7 @@ int net__socket_connect_step3(struct mosquitto *mosq, const char *host) int rc = net__init_ssl_ctx(mosq); if(rc){ - net__socket_close_compat(mosq); + net__socket_close(mosq); return rc; } @@ -882,7 +872,7 @@ int net__socket_connect_step3(struct mosquitto *mosq, const char *host) } mosq->ssl = SSL_new(mosq->ssl_ctx); if(!mosq->ssl){ - net__socket_close_compat(mosq); + net__socket_close(mosq); net__print_ssl_error(mosq); return MOSQ_ERR_TLS; } @@ -890,7 +880,7 @@ int net__socket_connect_step3(struct mosquitto *mosq, const char *host) SSL_set_ex_data(mosq->ssl, tls_ex_index_mosq, mosq); bio = BIO_new_socket(mosq->sock, BIO_NOCLOSE); if(!bio){ - net__socket_close_compat(mosq); + net__socket_close(mosq); net__print_ssl_error(mosq); return MOSQ_ERR_TLS; } @@ -900,12 +890,12 @@ int net__socket_connect_step3(struct mosquitto *mosq, const char *host) * required for the SNI resolving */ if(SSL_set_tlsext_host_name(mosq->ssl, host) != 1) { - net__socket_close_compat(mosq); + net__socket_close(mosq); return MOSQ_ERR_TLS; } if(net__socket_connect_tls(mosq)){ - net__socket_close_compat(mosq); + net__socket_close(mosq); return MOSQ_ERR_TLS; }