Skip to content

Commit 087a3e9

Browse files
committed
OTA: fix content length comparison warning
1 parent 3cf10b4 commit 087a3e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ota/interface/OTAInterfaceDefault.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ OTACloudProcessInterface::State OTADefaultCloudProcessInterface::startOTA() {
5555
}
5656

5757
// The following call is required to save the header value , keep it
58-
context->contentLength = http_client->contentLength();
59-
if(context->contentLength == HttpClient::kNoContentLengthHeader) {
58+
if(http_client->contentLength() == HttpClient::kNoContentLengthHeader) {
6059
DEBUG_VERBOSE("OTA ERROR: the response header doesn't contain \"ContentLength\" field");
6160
return HttpHeaderErrorFail;
6261
}
6362

63+
context->contentLength = http_client->contentLength();
6464
context->lastReportTime = millis();
6565
DEBUG_VERBOSE("OTA file length: %d", context->contentLength);
6666
return Fetch;

0 commit comments

Comments
 (0)