mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-24 19:41:57 +00:00
Closing http connections after receiving data
This commit is contained in:
parent
88528b4099
commit
75956c087c
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user