[Opensrf-commits] r1561 - trunk/src/perl/lib/OpenSRF/Transport/SlimJabber

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Dec 22 15:27:31 EST 2008


Author: erickson
Date: 2008-12-22 15:27:27 -0500 (Mon, 22 Dec 2008)
New Revision: 1561

Modified:
   trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/Inbound.pm
Log:
handle the case where only one service is registered for a given router

Modified: trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/Inbound.pm
===================================================================
--- trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/Inbound.pm	2008-12-22 19:14:48 UTC (rev 1560)
+++ trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/Inbound.pm	2008-12-22 20:27:27 UTC (rev 1561)
@@ -97,7 +97,11 @@
 
         for my $router (@$routers) {
             if(ref $router) {
-                if( !$router->{services} || grep { $_ eq $self->{app} } @{$router->{services}->{service}} ) {
+                if( !$router->{services} || 
+                        ( ref($router->{services}) eq 'ARRAY' and 
+                            grep { $_ eq $self->{app} } @{$router->{services}->{service}} )  ||
+                        $router->{services}->{service} eq $self->{app}) {
+
                     my $name = $router->{name};
                     my $domain = $router->{domain};
                     my $target = "$name\@$domain/router";
@@ -114,7 +118,8 @@
         }
 		
 	} catch Error with {
-		$logger->transport( $self->{app} . ": No routers defined" , WARN ); 
+        my $err = shift;
+		$logger->error($self->{app} . ": No routers defined: $err");
 		# no routers defined
 	};
 



More information about the opensrf-commits mailing list