1
0
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:
Sandeep Mistry 2016-06-17 14:37:51 -04:00
parent bfedff87c1
commit 4b6f4dfa29

View File

@ -6,8 +6,8 @@
// outputs the content to the serial port
#include <SPI.h>
#include <ArduinoHttpClient.h>
#include <WiFi101.h>
#include <ArduinoHttpClient.h>
// This example downloads the URL "http://arduino.cc/"
@ -82,6 +82,7 @@ void loop()
char c;
// Whilst we haven't timed out & haven't reached the end of the body
while ( (http.connected() || http.available()) &&
(bodyLen > 0 || bodyLen != HttpClient::kNoContentLengthHeader) &&
((millis() - timeoutStart) < kNetworkTimeout) )
{
if (http.available())