Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Fix AsyncWebSocketControl sending the same ping control packet more than once, breaking websocket sending altogether. #1390

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/AsyncWebSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ class AsyncWebSocketControl {
uint8_t opcode(){ return _opcode; }
uint8_t len(){ return _len + 2; }
size_t send(AsyncClient *client){
if (_finished)
return 0;
_finished = true;
return webSocketSendFrame(client, true, _opcode & 0x0F, _mask, _data, _len);
}
Expand Down
3 changes: 2 additions & 1 deletion src/AsyncWebSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ class AsyncWebSocketClient {

uint8_t _pstate;
AwsFrameInfo _pinfo;

public:
uint32_t _lastMessageTime;
private:
uint32_t _keepAlivePeriod;

void _queueMessage(AsyncWebSocketMessage *dataMessage);
Expand Down