-
Notifications
You must be signed in to change notification settings - Fork 9
Address matching, glob / wildcards #15
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
Comments
It looks like this is a misunderstanding of the OSC spec: var invalidAddressRunes = []rune{'*', '?', ',', '[', ']', '{', '}', '#', ' '} "// ValidateAddress returns an error if addr contains Line 34 in ba4a707
I think the OSC spec doesn't talk about OSC addresses, but about those "printable ASCII characters not allowed in names of OSC Methods or OSC Containers" |
I've found the same issue, and I've found the soultion too, I think it's a simple accident: Here: Line 92 in 53342a9
should be just
When I'll ihave time I might open a PR on that. |
Finally someone else who seems to use this library. :) If that works, great find. Yes please a PR would be welcome. My biggest practical issue with this library is currently this one: I've to use a external tool which uses the hypebeast/go-osc library to send a empty string (to a client that uses the C/C++ liblo library). Would be nice if these issues can be sorted out, in general this library is really useful for me. |
It indeed attempts to support Regex, so my second msg in this thread is a wrong assumption. Looking at this func: Line 147 in 53342a9
It seems to expect that both addresses have the same amount of parts, maybe there it goes wrong? If the address in the handler is /foo/bar/one /foo/* wouldn't work, cause it doesn't have the same number of parts, while /foo/*/* should work I think. |
Thats true, so the message address should have the same number of parts (splitted by /), and then the pattern matching occurs. So saying "*" will only match /foo or /bar, not /foo/bar. So then the pattern matching had a little mixup, for which I just opened the PR to fix. |
I doubt this is what 'we' want. I saw @briansorahan was also doing stuff around the Non-Session-Manager api and for broadcasting it seems it has to accept all paths. So it would be good if this library would support this. From nsm.h which uses the c/c++ liblo library: lo_server_add_method( _NSM()->_server, "/error", "sis", _nsm_osc_error, _NSM() ); path | The OSC path to register the method to. If NULL is passed the method will match all paths. |
Yes, you are right, I have a PR on adding a regexp matcher already, see: #20! But, you can make your own meanwhile just implement the Dispatcher interface! |
(Or you can copy from my code, or customize the one from here: https://github.com/scgolang/osc/blob/master/customdispatcher_example_test.go) |
Thanks, I'll look at it more closely when I've more time. |
Is there support for OSC address pattern wildcards like '*', '?', '{,}' and '[]'?
The text was updated successfully, but these errors were encountered: