From 3d201c71f7d7a7c799eb02580adfa8d9e9338178 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 19 Dec 2023 22:37:16 -0800 Subject: [PATCH] [ntcore] Fix overlapping subscriber handling (#6067) --- ntcore/src/main/native/cpp/net/ServerImpl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ntcore/src/main/native/cpp/net/ServerImpl.cpp b/ntcore/src/main/native/cpp/net/ServerImpl.cpp index cd5a23c51ea..8dc5291a4ad 100644 --- a/ntcore/src/main/native/cpp/net/ServerImpl.cpp +++ b/ntcore/src/main/native/cpp/net/ServerImpl.cpp @@ -1708,7 +1708,9 @@ ServerImpl::TopicData* ServerImpl::CreateTopic(ClientData* client, auto& tcd = topic->clients[aClient.get()]; bool added = false; for (auto subscriber : subscribers) { - added = added || tcd.AddSubscriber(subscriber); + if (tcd.AddSubscriber(subscriber)) { + added = true; + } } if (added) { aClient->UpdatePeriod(tcd, topic);