Skip to content

Commit 4534b64

Browse files
ci(pre-commit): Apply automatic fixes
1 parent 91e4f1a commit 4534b64

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/LOCKING_RULES_FOR_CLIENT.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ _client->onPoll(...);
3030
3131
### 2. AsyncClient Callback Context (_onData, _onPoll, _onAck, _onTimeout, _onError)
3232
**Context**: Runs from AsyncClient's internal task (typically AsyncTCP/same core)
33-
**Rule**:
33+
**Rule**:
3434
- These methods are called FROM AsyncClient; they are NOT called from application/user context
3535
- Only AsyncClient callbacks can change `_client` state to null (via onDisconnect callback)
3636
- **Within these methods**, if you read `_client`, it won't become null mid-execution (single-threaded from client perspective)
@@ -136,14 +136,14 @@ void AsyncWebSocketClient::close_SAFE(uint16_t code, const char *message) {
136136
client_to_close = _client;
137137
// Do NOT null _client here; let _onDisconnect do it
138138
}
139-
139+
140140
// Now outside lock, we can safely call client_to_close because:
141141
// 1. We captured it under lock
142142
// 2. It may be freed by the onDisconnect callback, but that's AsyncClient's responsibility
143143
// 3. We do NOT dereference unless we re-check _client under lock
144-
144+
145145
async_ws_log_w("[%s][%" PRIu32 "] CLOSE", _server->url(), _clientId);
146-
146+
147147
if (code) {
148148
// ... queue close frame ...
149149
}

0 commit comments

Comments
 (0)