Skip to content

Commit

Permalink
delete already closed client on closeSameClients
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianluca-Casagrande-Stiga committed Jan 8, 2024
1 parent f625f1b commit 97a1f0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion aedes.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ function Aedes (opts) {
const clientId = packet.payload.toString()

if (that.clients[clientId] && serverId !== that.id) {
that.clients[clientId].close(done)
if (that.clients[clientId].closed) {
// remove the client from the list if it is already closed
delete that.clients[clientId]
done()
} else {
that.clients[clientId].close(done)
}
} else {
done()
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aedes",
"version": "0.50.1",
"version": "0.50.2",
"description": "Stream-based MQTT broker",
"main": "aedes.js",
"types": "aedes.d.ts",
Expand Down

0 comments on commit 97a1f0b

Please sign in to comment.