|
From: Stephen S. <rad...@gm...> - 2008-02-24 16:54:39
|
Camille,
On Sun, Feb 24, 2008 at 10:52 AM, Camille Troillard
<ca...@os...> wrote:
> Hi,
>
> I have tested pattern matching in liblo, but it was not successful.
> For example I send a message like "/{foo,bar} ,i 1" to a server which has
> already two osc methods registered as "/foo" and "/bar". I was expecting
> the handlers of those two methods to be called, but rather the wildcard
> handler is called with the path "/{foo,bar}".
>
> Maybe there is something I am missing, so I would appreciate greatly if
> someone could give me some info about the status of pattern matching in
> liblo.
You're right, there's an issue there.
I just did some tests with example_server modified to have /foo and
/bar handlers and got the following results:
(where "test -> handlers called")
1) /{foo,bar} -> generic, /foo
2) /{fo,ba}* -> generic, /foo, /bar
3) /* -> generic, /foo, /bar
4) /[fb]{oo,ar} -> generic, /foo
5) /[fb]{ar,oo} -> generic, /bar
6) /*{ar,oo} -> generic, /foo, /bar
It seems that cases 1, 4, and 5 are in error. Likely to do with the
{} curly bracket processing, since which handler is called is
obviously related to the order in which they appear.
Another case I noticed, with handlers for /foo/bar and /foo/bing, is
that sending "/*" triggers both handlers, when I believe perhaps it
should not trigger either. I may be wrong but it's my understanding
that wildcards should only match up to a '/' character.
Steve
|