mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-04 18:03:20 +03:00
add basic check for valid data for in updateSketch (first byte of bin is always 0xE9)
send SDK version by HTTP Update
This commit is contained in:
parent
8559c8bbb1
commit
f11c65e9a7
@ -414,6 +414,13 @@ bool EspClass::updateSketch(Stream& in, uint32_t size) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(addr == freeSpaceStart) {
|
||||
// check for valid first magic byte
|
||||
if(*((uint8 *) buffer.get()) != 0xE9) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
noInterrupts();
|
||||
rc = SPIWrite(addr, buffer.get(), willRead);
|
||||
interrupts();
|
||||
|
@ -72,6 +72,9 @@ t_httpUpdate_return ESP8266HTTPUpdate::update(const char *host, uint16_t port, c
|
||||
req += "\r\n"
|
||||
"x-ESP8266-chip-size: ";
|
||||
req += ESP.getFlashChipRealSize();
|
||||
req += "\r\n"
|
||||
"x-ESP8266-sdk-version: ";
|
||||
req += ESP.getSdkVersion();
|
||||
|
||||
if(current_version[0] != 0x00) {
|
||||
req += "\r\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user