From 7debbabdd21ed36521bb1c18db1fb32bc5973aa4 Mon Sep 17 00:00:00 2001 From: Noah Laptop Date: Tue, 26 May 2020 15:19:45 -0700 Subject: [PATCH] fix an issue where a driver desync would cause future connections to fail --- src/SSLClient.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/SSLClient.cpp b/src/SSLClient.cpp index 337843f..997b67f 100644 --- a/src/SSLClient.cpp +++ b/src/SSLClient.cpp @@ -51,10 +51,8 @@ SSLClient::SSLClient( Client& client, int SSLClient::connect(IPAddress ip, uint16_t port) { const char* func_name = __func__; // connection check - if (get_arduino_client().connected()) { - m_error("Cannot have two connections at the same time! Please create another SSLClient instance.", func_name); - return 0; - } + if (get_arduino_client().connected()) + m_warn("Arduino client is already connected? Continuing anyway...", func_name); // reset indexs for saftey m_write_idx = 0; // Warning for security @@ -74,10 +72,8 @@ int SSLClient::connect(IPAddress ip, uint16_t port) { int SSLClient::connect(const char *host, uint16_t port) { const char* func_name = __func__; // connection check - if (get_arduino_client().connected()) { - m_error("Cannot have two connections at the same time! Please create another SSLClient instance.", func_name); - return 0; - } + if (get_arduino_client().connected()) + m_warn("Arduino client is already connected? Continuing anyway...", func_name); // reset indexs for saftey m_write_idx = 0; // first we need our hidden client member to negotiate the socket for us,