From 886048e371fc141ebb7000d29daef8043e17d630 Mon Sep 17 00:00:00 2001 From: Neale Petrillo <82894027+econeale@users.noreply.github.com> Date: Tue, 22 Jun 2021 13:02:28 -0400 Subject: [PATCH] Changed startRequest logic to fix compiler warning Changed the startReqest client checking logic to iClient->connect(iServerName, iServerPort) < 1 to fix the error: ArduinoHttpClient-0.4.0/src/HttpClient.cpp:87:61: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses] if (!iClient->connect(iServerName, iServerPort) > 0) This is a problem when using ESP32 with compiler warnings enabled as they set the -Werror option. --- src/HttpClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HttpClient.cpp b/src/HttpClient.cpp index 1c73464..8a6f2b5 100644 --- a/src/HttpClient.cpp +++ b/src/HttpClient.cpp @@ -84,7 +84,7 @@ int HttpClient::startRequest(const char* aURLPath, const char* aHttpMethod, { if (iServerName) { - if (!(iClient->connect(iServerName, iServerPort) > 0)) + if (iClient->connect(iServerName, iServerPort) < 1) { #ifdef LOGGING Serial.println("Connection failed"); @@ -94,7 +94,7 @@ int HttpClient::startRequest(const char* aURLPath, const char* aHttpMethod, } else { - if (!(iClient->connect(iServerAddress, iServerPort) > 0)) + if (iClient->connect(iServerAddress, iServerPort) < 1) { #ifdef LOGGING Serial.println("Connection failed");