Skip to content

Commit

Permalink
[ntcore] Fix overlapping subscriber handling (wpilibsuite#6067)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson authored Dec 20, 2023
1 parent f029841 commit 3d201c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ntcore/src/main/native/cpp/net/ServerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3d201c7

Please sign in to comment.