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

Should decoder discard messages with invalid address? #25

Open
DrLuke opened this issue Jan 9, 2022 · 4 comments
Open

Should decoder discard messages with invalid address? #25

DrLuke opened this issue Jan 9, 2022 · 4 comments

Comments

@DrLuke
Copy link
Contributor

DrLuke commented Jan 9, 2022

I've been trying to implement a dispatcher and noticed that the current matcher is a bit unergonomic to use. The OscMessage's address is only checked for validity in the matcher. This results in having to check for address errors during address matching, which seems like the wrong place to do that, as a dispatcher will attempt to match with every OSC method, but every single one will fail due to the address being invalid, so the same work is done repeatedly.

I propose that we instead discard incoming OscMessages in the decoder, as an OscMessage without a valid address can not ever be matched anyway, and as a consequence always know that an OscMessage must have a valid address.

I wanted to gather thoughts on this before implementing it.

@klingtnet
Copy link
Owner

I propose that we instead discard incoming OscMessages in the decoder, as an OscMessage without a valid address can not ever be matched anyway, and as a consequence always know that an OscMessage must have a valid address.

I like the idea but the address check should be optional, i.e. configurable. OSC does specify an address pattern syntax but since they're only strings one can match however they like. So, I think it would be sensible to discard messages with invalid addresses by default but still allow to explicitly disable this check. What do you think?

@DrLuke
Copy link
Contributor Author

DrLuke commented Jan 18, 2022

Very good point, I didn't think about that! I'll whip up a PR after finishing my current PR.

@klingtnet
Copy link
Owner

Thanks for raising the question and I'm looking forward to the PR!

@eugenwintersberger
Copy link

Are there any plans to implement this? It would be great to turn off address checks. I am actually trying to write some code to control Ardour via OSC> It seems that Ardour uses #reply as an address in some responses which currently does not work with rosc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants