Unverified Commit 0c0bd86c authored by Jason2866's avatar Jason2866 Committed by GitHub

Backport: ArduinoOTA upload intermittent failure fixed (#9215)

* Backport: ArduinoOTA upload intermittent failure fixed

Backport of #4657

* Fix compile error
parent fda21f3a
......@@ -315,6 +315,10 @@ void ArduinoOTAClass::_runUpdate() {
size_t r = client.read(buf, available);
if(r != available){
log_w("didn't read enough! %u != %u", r, available);
if((int32_t) r<0) {
delay(1);
continue; //let's not try to write 4 gigabytes when client.read returns -1
}
}
written = Update.write(buf, r);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment