Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ntcore/src/main/native/cpp/server/ServerClient4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ void ServerClient4::SendValue(ServerTopic* topic, const Value& value,
void ServerClient4::SendAnnounce(ServerTopic* topic,
std::optional<int> pubuid) {
auto& sent = m_announceSent[topic];
if (sent) {
// Allow publish-triggered announcements (with pubuid) even if a
// subscription-triggered announcement was already sent, as the spec requires
// the server to respond to publish messages with an announcement containing
// the pubuid.
if (sent && !pubuid.has_value()) {
return;
}
sent = true;
Expand Down
6 changes: 5 additions & 1 deletion ntcore/src/main/native/cpp/server/ServerClientLocal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ void ServerClientLocal::SendAnnounce(ServerTopic* topic,
std::optional<int> pubuid) {
if (m_local) {
auto& sent = m_announceSent[topic];
if (sent) {
// Allow publish-triggered announcements (with pubuid) even if a
// subscription-triggered announcement was already sent, as the spec
// requires the server to respond to publish messages with an announcement
// containing the pubuid.
if (sent && !pubuid.has_value()) {
return;
}
sent = true;
Expand Down
Loading