Skip to content
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

Remove unnecessary checking of topic globs. (#793) #799

Merged
merged 1 commit into from
Oct 17, 2022
Merged
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
38 changes: 0 additions & 38 deletions rosbridge_library/src/rosbridge_library/capabilities/subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,25 +289,6 @@ def unsubscribe(self, msg):
self.basic_type_check(msg, self.unsubscribe_msg_fields)

topic = msg["topic"]
if Subscribe.topics_glob is not None and Subscribe.topics_glob:
self.protocol.log("debug", "Topic security glob enabled, checking topic: " + topic)
match = False
for glob in Subscribe.topics_glob:
if fnmatch.fnmatch(topic, glob):
self.protocol.log(
"debug",
"Found match with glob " + glob + ", continuing unsubscription...",
)
match = True
break
if not match:
self.protocol.log(
"warn",
"No match found for topic, cancelling unsubscription from: " + topic,
)
return
else:
self.protocol.log("debug", "No topic security glob, not checking unsubscription.")

if topic not in self._subscriptions:
return
Expand All @@ -332,25 +313,6 @@ def publish(self, topic, message, fragment_size=None, compression="none"):

"""
# TODO: fragmentation, proper ids
if Subscribe.topics_glob and Subscribe.topics_glob:
self.protocol.log("debug", "Topic security glob enabled, checking topic: " + topic)
match = False
for glob in Subscribe.topics_glob:
if fnmatch.fnmatch(topic, glob):
self.protocol.log(
"debug",
"Found match with glob " + glob + ", continuing topic publish...",
)
match = True
break
if not match:
self.protocol.log(
"warn",
"No match found for topic, cancelling topic publish to: " + topic,
)
return
else:
self.protocol.log("debug", "No topic security glob, not checking topic publish.")

outgoing_msg = {"op": "publish", "topic": topic}
if compression == "png":
Expand Down