mirror of
https://github.com/arduino-libraries/ArduinoHttpClient.git
synced 2025-04-19 21:22:15 +03:00
Add check for bodyLen in read loop
This commit is contained in:
parent
bfedff87c1
commit
4b6f4dfa29
@ -6,8 +6,8 @@
|
|||||||
// outputs the content to the serial port
|
// outputs the content to the serial port
|
||||||
|
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <ArduinoHttpClient.h>
|
|
||||||
#include <WiFi101.h>
|
#include <WiFi101.h>
|
||||||
|
#include <ArduinoHttpClient.h>
|
||||||
|
|
||||||
// This example downloads the URL "http://arduino.cc/"
|
// This example downloads the URL "http://arduino.cc/"
|
||||||
|
|
||||||
@ -82,6 +82,7 @@ void loop()
|
|||||||
char c;
|
char c;
|
||||||
// Whilst we haven't timed out & haven't reached the end of the body
|
// Whilst we haven't timed out & haven't reached the end of the body
|
||||||
while ( (http.connected() || http.available()) &&
|
while ( (http.connected() || http.available()) &&
|
||||||
|
(bodyLen > 0 || bodyLen != HttpClient::kNoContentLengthHeader) &&
|
||||||
((millis() - timeoutStart) < kNetworkTimeout) )
|
((millis() - timeoutStart) < kNetworkTimeout) )
|
||||||
{
|
{
|
||||||
if (http.available())
|
if (http.available())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user