fix an issue where a driver desync would cause future connections to fail
This commit is contained in:
parent
5d8fe824ee
commit
7debbabdd2
1 changed files with 4 additions and 8 deletions
|
@ -51,10 +51,8 @@ SSLClient::SSLClient( Client& client,
|
||||||
int SSLClient::connect(IPAddress ip, uint16_t port) {
|
int SSLClient::connect(IPAddress ip, uint16_t port) {
|
||||||
const char* func_name = __func__;
|
const char* func_name = __func__;
|
||||||
// connection check
|
// connection check
|
||||||
if (get_arduino_client().connected()) {
|
if (get_arduino_client().connected())
|
||||||
m_error("Cannot have two connections at the same time! Please create another SSLClient instance.", func_name);
|
m_warn("Arduino client is already connected? Continuing anyway...", func_name);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
// reset indexs for saftey
|
// reset indexs for saftey
|
||||||
m_write_idx = 0;
|
m_write_idx = 0;
|
||||||
// Warning for security
|
// Warning for security
|
||||||
|
@ -74,10 +72,8 @@ int SSLClient::connect(IPAddress ip, uint16_t port) {
|
||||||
int SSLClient::connect(const char *host, uint16_t port) {
|
int SSLClient::connect(const char *host, uint16_t port) {
|
||||||
const char* func_name = __func__;
|
const char* func_name = __func__;
|
||||||
// connection check
|
// connection check
|
||||||
if (get_arduino_client().connected()) {
|
if (get_arduino_client().connected())
|
||||||
m_error("Cannot have two connections at the same time! Please create another SSLClient instance.", func_name);
|
m_warn("Arduino client is already connected? Continuing anyway...", func_name);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
// reset indexs for saftey
|
// reset indexs for saftey
|
||||||
m_write_idx = 0;
|
m_write_idx = 0;
|
||||||
// first we need our hidden client member to negotiate the socket for us,
|
// first we need our hidden client member to negotiate the socket for us,
|
||||||
|
|
Loading…
Reference in a new issue