-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Subscribe Announces #303
base: main
Are you sure you want to change the base?
Conversation
auto it = conn_it->second.announce_subscriptions.find(ns_prefix); | ||
if (it != conn_it->second.announce_subscriptions.end()) { | ||
// do nothing | ||
return; | ||
} | ||
|
||
conn_it->second.announce_subscriptions[ns_prefix] = std::move(handler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it
already is conn_it->second.announce_subscriptions[ns_prefix]
, we don't need to look it up again. In map this is effectively an O(1) operation though, so maybe it doesn't matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but doesn't seem to be working correctly... likely because Contains()
is being used to match the track namespace prefix.
For example, subscribe to announces a,b
... Publish announces of a,b
works as expected, but does not work for a,b,?
and a,b,**
There isn't a debug message for the announce subscribe, but I did announce subscribe to x,y
and then published announce using x,y,z
which resulted in the below log message.
[2024-11-01 15:18:59.277] [info] [server.cpp:349] No match Found for announced namespace. prefix: x/y, namespace: x/y
Using anything other than x,y
for the announce, it doesn't match. If I publish announce using x,y
it does work with:
[2024-11-01 15:22:24.285] [info] [server.cpp:342] Found a match for announced namespace. prefix: x/y, namespace: x/y
So in other words, prefix matching is not working for announce subscribes.
No description provided.