router-less login mangling
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 17 Jun 2005 14:40:47 +0000 (14:40 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 17 Jun 2005 14:40:47 +0000 (14:40 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@346 9efc2488-bf62-4759-914b-345cdb29e865

src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm
src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm
src/perlmods/OpenSRF/Transport/SlimJabber/PeerConnection.pm

index de0554d..d903395 100644 (file)
@@ -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 {
 <stream:stream to='$host' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>
        XML
 
+       my $conf = OpenSRF::Utils::Config->current;
+       my $tail = "_$$";
+       if(!$conf->bootstrap->router_name && $username eq "router") {
+               $tail = "";
+       }
+
        my $auth = <<"  XML";
 <iq id='123' type='set'>
 <query xmlns='jabber:iq:auth'>
 <username>$username</username>
 <password>$password</password>
-<resource>${resource}_$$</resource>
+<resource>${resource}$tail</resource>
 </query>
 </iq>
        XML
index 11385d5..ad9a0d0 100644 (file)
@@ -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 );
 
index 330c665..1273ddc 100644 (file)
@@ -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" )