Browse Source

ws: create incoming buffer once, no need to delay

master
Max Prokhorov 5 years ago
parent
commit
b100d5f603
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      code/espurna/ws.ino

+ 1
- 2
code/espurna/ws.ino View File

@ -604,6 +604,7 @@ void _wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTy
_wsConnected(client->id()); _wsConnected(client->id());
_wsResetUpdateTimer(); _wsResetUpdateTimer();
wifiReconnectCheck(); wifiReconnectCheck();
client->_tempObject = new WebSocketIncommingBuffer(_wsParse, true);
} else if(type == WS_EVT_DISCONNECT) { } else if(type == WS_EVT_DISCONNECT) {
DEBUG_MSG_P(PSTR("[WEBSOCKET] #%u disconnected\n"), client->id()); DEBUG_MSG_P(PSTR("[WEBSOCKET] #%u disconnected\n"), client->id());
@ -670,9 +671,7 @@ void _wsHandleClientData(const bool connected) {
yield(); yield();
if (data.done()) { if (data.done()) {
// push the queue and finally allow incoming messages
_ws_client_data.pop(); _ws_client_data.pop();
ws_client->_tempObject = new WebSocketIncommingBuffer(_wsParse, true);
} }
} }


Loading…
Cancel
Save