mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Added missing calls to client.stop() in JsonHttpClient.ino (fixes #1485)
This commit is contained in:
		| @@ -5,6 +5,7 @@ HEAD | |||||||
| ---- | ---- | ||||||
|  |  | ||||||
| * Made `JsonDocument`'s destructor protected (issue #1480) | * Made `JsonDocument`'s destructor protected (issue #1480) | ||||||
|  | * Added missing calls to `client.stop()` in `JsonHttpClient.ino` (issue #1485) | ||||||
|  |  | ||||||
| v6.17.2 (2020-11-14) | v6.17.2 (2020-11-14) | ||||||
| ------- | ------- | ||||||
|   | |||||||
| @@ -53,6 +53,7 @@ void setup() { | |||||||
|   client.println(F("Connection: close")); |   client.println(F("Connection: close")); | ||||||
|   if (client.println() == 0) { |   if (client.println() == 0) { | ||||||
|     Serial.println(F("Failed to send request")); |     Serial.println(F("Failed to send request")); | ||||||
|  |     client.stop(); | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -63,6 +64,7 @@ void setup() { | |||||||
|   if (strcmp(status + 9, "200 OK") != 0) { |   if (strcmp(status + 9, "200 OK") != 0) { | ||||||
|     Serial.print(F("Unexpected response: ")); |     Serial.print(F("Unexpected response: ")); | ||||||
|     Serial.println(status); |     Serial.println(status); | ||||||
|  |     client.stop(); | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -70,6 +72,7 @@ void setup() { | |||||||
|   char endOfHeaders[] = "\r\n\r\n"; |   char endOfHeaders[] = "\r\n\r\n"; | ||||||
|   if (!client.find(endOfHeaders)) { |   if (!client.find(endOfHeaders)) { | ||||||
|     Serial.println(F("Invalid response")); |     Serial.println(F("Invalid response")); | ||||||
|  |     client.stop(); | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -83,6 +86,7 @@ void setup() { | |||||||
|   if (error) { |   if (error) { | ||||||
|     Serial.print(F("deserializeJson() failed: ")); |     Serial.print(F("deserializeJson() failed: ")); | ||||||
|     Serial.println(error.f_str()); |     Serial.println(error.f_str()); | ||||||
|  |     client.stop(); | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user