Skip to content

Commit 95089b7

Browse files
committed
fix startUpdate always false
1 parent b1ea7b6 commit 95089b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,17 @@ t_httpUpdate_return ESP8266HTTPUpdate::handleUpdate(HTTPClient * http, const cha
146146
switch(code) {
147147
case HTTP_CODE_OK: ///< OK (Start Update)
148148
if(len > 0) {
149-
bool startUpdate = false;
149+
bool startUpdate = true;
150150
if(spiffs) {
151151
size_t spiffsSize = ((size_t) &_SPIFFS_end - (size_t) &_SPIFFS_start);
152152
if(len > (int) spiffsSize) {
153153
DEBUG_HTTP_UPDATE("[httpUpdate] spiffsSize to low (%d) needed: %d\n", spiffsSize, len);
154+
startUpdate = false;
154155
}
155156
} else {
156157
if(len > (int) ESP.getFreeSketchSpace()) {
157158
DEBUG_HTTP_UPDATE("[httpUpdate] FreeSketchSpace to low (%d) needed: %d\n", ESP.getFreeSketchSpace(), len);
159+
startUpdate = false;
158160
}
159161
}
160162

0 commit comments

Comments
 (0)