diff --git a/src/HTTPConnection.cpp b/src/HTTPConnection.cpp index e26a846..eb7ae69 100644 --- a/src/HTTPConnection.cpp +++ b/src/HTTPConnection.cpp @@ -149,7 +149,7 @@ void HTTPConnection::closeConnection() { * This method will try to fill up the buffer with data from */ int HTTPConnection::updateBuffer() { - if (!isClosed()) { + if (!isClosed()||canReadData()) { // If there is buffer data that has been marked as processed. // Some example is shown here: diff --git a/src/HTTPConnection.hpp b/src/HTTPConnection.hpp index fb15d7a..f3a3375 100644 --- a/src/HTTPConnection.hpp +++ b/src/HTTPConnection.hpp @@ -6,7 +6,11 @@ #include #include +#ifdef ESP32 +#include +#else #include +#endif #include // Required for sockets