Ochrana pred preplnenim vyrovnavaci fronty weboveho soketu

This commit is contained in:
Pavel Brychta 2022-11-09 11:25:48 +01:00
parent 14492ac2d0
commit 9f29c8b1b1

View File

@ -270,9 +270,11 @@ void trace_poll()
log = F("{\"type\":\"trace\",\"data\":["); log = F("{\"type\":\"trace\",\"data\":[");
trace_dumpJSON(log); trace_dumpJSON(log);
log.concat(F("]}")); log.concat(F("]}"));
_wss->textAll(log); if (_wss->availableForWriteAll())
_wss->textAll(log);
} else } else
_wss->textAll(F("{\"type\":\"trace\",\"text\":\"Memory error\"}")); if (_wss->availableForWriteAll())
_wss->textAll(F("{\"type\":\"trace\",\"text\":\"Memory error\"}"));
} }
} else } else
_modified = 0; // zadny pripojeny klient - po pripojeni stejne musime vyzadat stav, takze ted muzeme modifikaci klidne ignorovat _modified = 0; // zadny pripojeny klient - po pripojeni stejne musime vyzadat stav, takze ted muzeme modifikaci klidne ignorovat