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


Loading…
Cancel
Save