From 75956c087c485c4f1a84f6db489eb8d89f323414 Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Mon, 11 Jan 2021 09:49:25 +0100 Subject: [PATCH] Closing http connections after receiving data --- src/entsoe/EntsoeApi.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/entsoe/EntsoeApi.cpp b/src/entsoe/EntsoeApi.cpp index 3ec8dcdb..08058376 100644 --- a/src/entsoe/EntsoeApi.cpp +++ b/src/entsoe/EntsoeApi.cpp @@ -177,12 +177,14 @@ bool EntsoeApi::retrieve(const char* url, Stream* doc) { int status = https.GET(); if(status == HTTP_CODE_OK) { https.writeToStream(doc); + https.end(); return true; } else { printE("Communication error: "); printE(https.errorToString(status)); printI(url); printD(https.getString()); + https.end(); return false; } } else { @@ -225,6 +227,7 @@ double EntsoeApi::getCurrencyMultiplier(const char* from, const char* to) { printD(https.getString()); } lastCurrencyFetch = now; + https.end(); } else { return false; }