I had the same issue but after a bit of digging around on the net I've
managed to patch the XS code and module, the below patch will fix the
issue. Hopefully Nicholas can add it into the code when he gets a chance.
I looked at Net::OpenSoundControl first, but that seemed a lot slower, I
assume it's written entirely in Perl, rather than the C of Net::LibLO.
Anyway it's a very nice module, hopefully this patch will improve it
further. I've not dealt with test scripts before, so I'll leave that to
Nicholas or someone else.
PN
diff -urpN Net-LibLO-0.06/lib/Net/LibLO.pm Net-LibLO-Global/lib/Net/LibLO.pm
--- Net-LibLO-0.06/lib/Net/LibLO.pm 2007-03-09 21:00:50.000000000 +0000
+++ Net-LibLO-Global/lib/Net/LibLO.pm 2011-08-23 20:34:49.000000000 +0100
@@ -103,7 +103,7 @@ sub add_method {
# Check parameters
carp "Missing typespec parameter" unless (defined $typespec);
- carp "Missing path parameter" unless (defined $path);
+ #carp "Missing path parameter" unless (defined $path); #Allow undef
for the global matchall
carp "Missing handler parameter" unless (defined $handler);
carp "Handler parameter isn't a code reference" unless
(ref($handler) eq 'CODE');
#carp "Handle parameter isn't subroutine reference" unless (ref
diff -urpN Net-LibLO-0.06/lib/Net/LibLO.xs Net-LibLO-Global/lib/Net/LibLO.xs
--- Net-LibLO-0.06/lib/Net/LibLO.xs 2007-03-09 21:00:50.000000000 +0000
+++ Net-LibLO-Global/lib/Net/LibLO.xs 2011-08-23 20:30:49.000000000 +0100
@@ -353,11 +353,12 @@ lo_server_get_url( server )
lo_method
lo_server_add_method( server, path, typespec, userdata )
lo_server server
- const char* path
+ SV* path
const char* typespec
SV* userdata
CODE:
- RETVAL = lo_server_add_method( server, path, typespec,
xs_liblo_handler, newSVsv(userdata) );
+ path = SvOK(ST(1)) ? ((SV*)SvPV_nolen(ST(1))) : NULL;
+ RETVAL = lo_server_add_method( server, (const char*)path,
typespec, xs_liblo_handler, newSVsv(userdata) );
OUTPUT:
RETVAL