Skip to content

Commit 886048e

Browse files
authored
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.
1 parent 1751e10 commit 886048e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/HttpClient.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ int HttpClient::startRequest(const char* aURLPath, const char* aHttpMethod,
8484
{
8585
if (iServerName)
8686
{
87-
if (!(iClient->connect(iServerName, iServerPort) > 0))
87+
if (iClient->connect(iServerName, iServerPort) < 1)
8888
{
8989
#ifdef LOGGING
9090
Serial.println("Connection failed");
@@ -94,7 +94,7 @@ int HttpClient::startRequest(const char* aURLPath, const char* aHttpMethod,
9494
}
9595
else
9696
{
97-
if (!(iClient->connect(iServerAddress, iServerPort) > 0))
97+
if (iClient->connect(iServerAddress, iServerPort) < 1)
9898
{
9999
#ifdef LOGGING
100100
Serial.println("Connection failed");

0 commit comments

Comments
 (0)