From edd73732be2fa333a2ef95df144b684009df985c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Andr=C3=A1ssy?= Date: Thu, 14 Dec 2023 16:30:15 +0100 Subject: [PATCH] LwipClient - op bool fix op bool should return false only for a 'null' client. a closed client may still have data to read. a Client returned from Server.available() should not fail on usual bool test if it has data available. --- libraries/lwIpWrapper/src/lwipClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/lwIpWrapper/src/lwipClient.cpp b/libraries/lwIpWrapper/src/lwipClient.cpp index 8facb2525..745f4d504 100644 --- a/libraries/lwIpWrapper/src/lwipClient.cpp +++ b/libraries/lwIpWrapper/src/lwipClient.cpp @@ -243,7 +243,7 @@ uint8_t lwipClient::status() lwipClient::operator bool() { /* -------------------------------------------------------------------------- */ - return (_tcp_client && (_tcp_client->state != TCP_CLOSING)); + return (_tcp_client != nullptr); } /* -------------------------------------------------------------------------- */