Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 51fd4a868a |
@@ -315,7 +315,11 @@ static bool writeImage(const manifest_t& m, const esp_partition_t* part) {
|
||||
while (ok && got < m.size) {
|
||||
size_t avail = stream->available();
|
||||
if (avail == 0) {
|
||||
if (!http.connected() || millis() - last_rx > STALL_TIMEOUT_MS) {
|
||||
// connected() can read false for a moment between TLS records, so a
|
||||
// drop only counts after 2 s of silence (it aborted a download at
|
||||
// 570 B once, 2026-09-26; the retry went through).
|
||||
uint32_t idle = millis() - last_rx;
|
||||
if ((!http.connected() && idle > 2000) || idle > STALL_TIMEOUT_MS) {
|
||||
print("[ota] download stalled at %lu/%lu bytes", (unsigned long)got, (unsigned long)m.size);
|
||||
ok = false;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user