From c72eccdd35c0f8451988d59be390e1068e2e9798 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Mon, 1 Feb 2021 09:16:23 +0100 Subject: [PATCH] Added missing calls to client.stop() in JsonHttpClient.ino (fixes #1485) --- CHANGELOG.md | 1 + examples/JsonHttpClient/JsonHttpClient.ino | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6ef04d3..d8d08de9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ HEAD ---- * Made `JsonDocument`'s destructor protected (issue #1480) +* Added missing calls to `client.stop()` in `JsonHttpClient.ino` (issue #1485) v6.17.2 (2020-11-14) ------- diff --git a/examples/JsonHttpClient/JsonHttpClient.ino b/examples/JsonHttpClient/JsonHttpClient.ino index b8c2d665..ff110963 100644 --- a/examples/JsonHttpClient/JsonHttpClient.ino +++ b/examples/JsonHttpClient/JsonHttpClient.ino @@ -53,6 +53,7 @@ void setup() { client.println(F("Connection: close")); if (client.println() == 0) { Serial.println(F("Failed to send request")); + client.stop(); return; } @@ -63,6 +64,7 @@ void setup() { if (strcmp(status + 9, "200 OK") != 0) { Serial.print(F("Unexpected response: ")); Serial.println(status); + client.stop(); return; } @@ -70,6 +72,7 @@ void setup() { char endOfHeaders[] = "\r\n\r\n"; if (!client.find(endOfHeaders)) { Serial.println(F("Invalid response")); + client.stop(); return; } @@ -83,6 +86,7 @@ void setup() { if (error) { Serial.print(F("deserializeJson() failed: ")); Serial.println(error.f_str()); + client.stop(); return; }