From: erickson Date: Fri, 17 Jun 2005 14:40:47 +0000 (+0000) Subject: router-less login mangling X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0386a573fd9aaf9aedc94e7b07b209f7f49bab33;p=opensrf%2Fbjwebb.git router-less login mangling git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@346 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm b/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm index de0554d..d903395 100644 --- a/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm +++ b/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm @@ -5,6 +5,7 @@ use base qw( OpenSRF ); use OpenSRF::Utils::Logger qw(:level); use OpenSRF::Utils::Config; use Time::HiRes qw(ualarm); +use OpenSRF::Utils::Config; use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK); use IO::Socket::INET; @@ -441,12 +442,18 @@ sub initialize { XML + my $conf = OpenSRF::Utils::Config->current; + my $tail = "_$$"; + if(!$conf->bootstrap->router_name && $username eq "router") { + $tail = ""; + } + my $auth = <<" XML"; $username $password -${resource}_$$ +${resource}$tail XML diff --git a/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm b/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm index 11385d5..ad9a0d0 100644 --- a/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm +++ b/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm @@ -43,7 +43,10 @@ This service should be loaded at system startup. my $router_name = $conf->bootstrap->router_name; # no router, only one listener running.. - if(!$router_name) { $resource = $app; } + if(!$router_name) { + $username = "router"; + $resource = $app; + } OpenSRF::Utils::Logger->transport("Inbound as $username, $password, $resource, $host, $port\n", INTERNAL ); diff --git a/src/perlmods/OpenSRF/Transport/SlimJabber/PeerConnection.pm b/src/perlmods/OpenSRF/Transport/SlimJabber/PeerConnection.pm index 330c665..1273ddc 100644 --- a/src/perlmods/OpenSRF/Transport/SlimJabber/PeerConnection.pm +++ b/src/perlmods/OpenSRF/Transport/SlimJabber/PeerConnection.pm @@ -62,10 +62,10 @@ sub new { if( $app eq "client" ) { $resource = "client_at_$h"; } - unless ( $conf->bootstrap->router_name ) { - $username = 'router'; - $resource = $app; - } +# unless ( $conf->bootstrap->router_name ) { +# $username = 'router'; +# $resource = $app; +# } OpenSRF::EX::Config->throw( "JPeer could not load all necesarry values from config" )