From 9f29c8b1b11d71571c2c756d1a7f44d995a27851 Mon Sep 17 00:00:00 2001 From: Pavel Brychta Date: Wed, 9 Nov 2022 11:25:48 +0100 Subject: [PATCH] Ochrana pred preplnenim vyrovnavaci fronty weboveho soketu --- src/trace.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/trace.cpp b/src/trace.cpp index 86e718e..814484b 100644 --- a/src/trace.cpp +++ b/src/trace.cpp @@ -270,9 +270,11 @@ void trace_poll() log = F("{\"type\":\"trace\",\"data\":["); trace_dumpJSON(log); log.concat(F("]}")); - _wss->textAll(log); + if (_wss->availableForWriteAll()) + _wss->textAll(log); } else - _wss->textAll(F("{\"type\":\"trace\",\"text\":\"Memory error\"}")); + if (_wss->availableForWriteAll()) + _wss->textAll(F("{\"type\":\"trace\",\"text\":\"Memory error\"}")); } } else _modified = 0; // zadny pripojeny klient - po pripojeni stejne musime vyzadat stav, takze ted muzeme modifikaci klidne ignorovat