Skip to content

Commit

Permalink
Fixing mulitple sends of the DISCONNECT message to the client.
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Jul 9, 2023
1 parent bc22158 commit 08c6e5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gateway/src/lib/session_op/PubSend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ void PubSend::newSends()
}

if (st.m_pendingClientDisconnect) {
sendDisconnect();
if (!m_disconnectAlreadySent) {
sendDisconnect();
m_disconnectAlreadySent = true;
}
return;
}

Expand Down
1 change: 1 addition & 0 deletions gateway/src/lib/session_op/PubSend.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class PubSend : public SessionOp
bool m_registered = false;
bool m_acked = false;
bool m_ping = false;
bool m_disconnectAlreadySent = false;
};

} // namespace session_op
Expand Down

0 comments on commit 08c6e5f

Please sign in to comment.