mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-06 05:21:22 +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:
parent
ad2b51e36f
commit
8b1af68e3f
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user