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;
<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
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 );
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" )