1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-07 16:23:38 +03:00

Infinite loop while passing File(FS.h) resolved (#5038)

Stream.available() never reaches to -1 which makes it an infinite loop. When File (FS.h) goes empty it reaches to 0 not -1.
This commit is contained in:
mayankgour13 2019-07-05 18:32:01 +05:30 committed by Develo
parent ad2b51e36f
commit 8b1af68e3f

View File

@ -761,7 +761,7 @@ int HTTPClient::sendRequest(const char * type, Stream * stream, size_t size)
if(buff) {
// read all data from stream and send it to server
while(connected() && (stream->available() > -1) && (len > 0 || len == -1)) {
while(connected() && (stream->available() > 0) && (len > 0 || len == -1)) {
// get available data size
int sizeAvailable = stream->available();