Skip to content

Commit

Permalink
[ntcore] Avoid duplicate addition of publishers in server
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson committed Sep 8, 2024
1 parent a9b8850 commit 3dde697
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ntcore/src/main/native/cpp/net/ServerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,13 @@ void ServerImpl::ClientData4Base::ClientPublish(int64_t pubuid,
pubuid, std::make_unique<PublisherData>(this, topic, pubuid));
if (!isNew) {
WARN("client {} duplicate publish of pubuid {}", m_id, pubuid);
}

// add publisher to topic
topic->AddPublisher(this, publisherIt->getSecond().get());
} else {
// add publisher to topic
topic->AddPublisher(this, publisherIt->getSecond().get());

// update meta data
m_server.UpdateMetaTopicPub(topic);
// update meta data
m_server.UpdateMetaTopicPub(topic);
}

// respond with announce with pubuid to client
DEBUG4("client {}: announce {} pubuid {}", m_id, topic->name, pubuid);
Expand Down

0 comments on commit 3dde697

Please sign in to comment.