Skip to content

Commit 9847e1f

Browse files
authored
Merge branch 'master' into wifioff
2 parents 2d1cb1c + 521ae60 commit 9847e1f

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

cores/esp8266/core_esp8266_postmortem.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ static void cut_here() {
110110
ets_putc('\n');
111111
}
112112

113+
static inline bool is_pc_valid(uint32_t pc) {
114+
return pc >= XCHAL_INSTRAM0_VADDR && pc < (XCHAL_INSTROM0_VADDR + XCHAL_INSTROM0_SIZE);
115+
}
116+
113117
/*
114118
Add some assembly to grab the stack pointer and pass it as an argument before
115119
it grows for the target function. Should stabilize the stack offsets, used to
@@ -125,7 +129,7 @@ asm(
125129
"\n"
126130
"__wrap_system_restart_local:\n\t"
127131
"mov a2, a1\n\t"
128-
"j postmortem_report\n\t"
132+
"j.l postmortem_report, a3\n\t"
129133
".size __wrap_system_restart_local, .-__wrap_system_restart_local\n\t"
130134
);
131135

@@ -183,7 +187,7 @@ static void postmortem_report(uint32_t sp_dump) {
183187
else if (rst_info.reason == REASON_SOFT_WDT_RST) {
184188
ets_printf_P(PSTR("\nSoft WDT reset"));
185189
const char infinite_loop[] = { 0x06, 0xff, 0xff }; // loop: j loop
186-
if (0 == memcmp_P(infinite_loop, (PGM_VOID_P)rst_info.epc1, 3u)) {
190+
if (is_pc_valid(rst_info.epc1) && 0 == memcmp_P(infinite_loop, (PGM_VOID_P)rst_info.epc1, 3u)) {
187191
// The SDK is riddled with these. They are usually preceded by an ets_printf.
188192
ets_printf_P(PSTR(" - deliberate infinite loop detected"));
189193
}

libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,13 @@ void ESP8266WebServerTemplate<ServerType>::serveStatic(const char* uri, FS& fs,
281281
template <typename ServerType>
282282
void ESP8266WebServerTemplate<ServerType>::handleClient() {
283283
if (_currentStatus == HC_NONE) {
284-
ClientType client = _server.accept();
285-
if (!client) {
284+
_currentClient = _server.accept();
285+
if (!_currentClient) {
286286
return;
287287
}
288288

289289
DBGWS("New client\n");
290290

291-
_currentClient = client;
292291
_currentStatus = HC_WAIT_READ;
293292
_statusChange = millis();
294293
}

libraries/ESP8266WiFi/src/WiFiClient.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ class WiFiClient : public Client, public SList<WiFiClient> {
107107
static void stopAll();
108108
static void stopAllExcept(WiFiClient * c);
109109

110-
void keepAlive (uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT);
111-
bool isKeepAliveEnabled () const;
112-
uint16_t getKeepAliveIdle () const;
113-
uint16_t getKeepAliveInterval () const;
114-
uint8_t getKeepAliveCount () const;
115-
void disableKeepAlive () { keepAlive(0, 0, 0); }
110+
virtual void keepAlive (uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT);
111+
virtual bool isKeepAliveEnabled () const;
112+
virtual uint16_t getKeepAliveIdle () const;
113+
virtual uint16_t getKeepAliveInterval () const;
114+
virtual uint8_t getKeepAliveCount () const;
115+
virtual void disableKeepAlive () { keepAlive(0, 0, 0); }
116116

117117
// default NoDelay=False (Nagle=True=!NoDelay)
118118
// Nagle is for shortly delaying outgoing data, to send less/bigger packets

libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,21 @@ class WiFiClientSecure : public WiFiClient {
357357

358358
// consume bytes after use (see peekBuffer)
359359
virtual void peekConsume (size_t consume) override { return _ctx->peekConsume(consume); }
360+
361+
void keepAlive(uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT) override
362+
{
363+
_ctx->keepAlive(idle_sec, intv_sec, count);
364+
}
365+
366+
bool isKeepAliveEnabled() const override { return _ctx->isKeepAliveEnabled(); };
367+
368+
uint16_t getKeepAliveIdle() const override { return _ctx->getKeepAliveIdle(); };
369+
370+
uint16_t getKeepAliveInterval() const override { return _ctx->getKeepAliveInterval(); };
371+
372+
uint8_t getKeepAliveCount() const override { return _ctx->getKeepAliveCount(); };
373+
374+
void disableKeepAlive() override { _ctx->disableKeepAlive(); };
360375

361376
private:
362377
std::shared_ptr<WiFiClientSecureCtx> _ctx;

0 commit comments

Comments
 (0)