From 0de0d3f79a71d5d5ab8a34d5cba90680e7d29036 Mon Sep 17 00:00:00 2001 From: atanisoft Date: Tue, 18 Dec 2018 10:21:36 -0800 Subject: [PATCH] move call to setTimeout() to after the client connects. (#2214) This is necessary to avoid this log entry from being generated due to invalid usage of setTimeout: [E][WiFiClient.cpp:236] setSocketOption(): 1006 : 9 --- libraries/HTTPClient/src/HTTPClient.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/HTTPClient/src/HTTPClient.cpp b/libraries/HTTPClient/src/HTTPClient.cpp index ffeada6b2a8..3005d55e408 100644 --- a/libraries/HTTPClient/src/HTTPClient.cpp +++ b/libraries/HTTPClient/src/HTTPClient.cpp @@ -966,14 +966,14 @@ bool HTTPClient::connect(void) return false; } - // set Timeout for WiFiClient and for Stream::readBytesUntil() and Stream::readStringUntil() - _client->setTimeout((_tcpTimeout + 500) / 1000); - if(!_client->connect(_host.c_str(), _port)) { log_d("failed connect to %s:%u", _host.c_str(), _port); return false; } + // set Timeout for WiFiClient and for Stream::readBytesUntil() and Stream::readStringUntil() + _client->setTimeout((_tcpTimeout + 500) / 1000); + log_d(" connected to %s:%u", _host.c_str(), _port); #ifdef HTTPCLIENT_1_1_COMPATIBLE