15May01=======================================================================
1. set/lockout now prevents any outgoing connection taking place.
+2. Started the new routing stuff which will run in parallel for a while.
+3. changed the msg timeout arrangements so that it might not get stuck so
+easily.
14May01=======================================================================
1. fix problem with re-reading in db definitions for remote databases.
2. try to prevent situations where two can (semi) successfully login, probably
use strict;
my ($self, $line) = @_;
my @list = split /\s+/, $line; # generate a list of callsigns
-@list = ($self->call) if !@list || $self->priv < 9; # my channel if no callsigns
+@list = ($self->call) if !@list || $self->priv < 1; # my channel if no callsigns
my $call;
my @out;
if ($main::systime >= $lastq + $queueinterval) {
- # wander down the work queue stopping any messages that have timed out
- for (keys %busy) {
- my $node = $_;
- my $ref = $busy{$_};
- if (exists $ref->{lastt} && $main::systime >= $ref->{lastt} + $timeout) {
- dbg('msg', "Timeout, stopping msgno: $ref->{msgno} -> $node");
- Log('msg', "Timeout, stopping msgno: $ref->{msgno} -> $node");
- $ref->stop_msg($node);
-
- # delay any outgoing messages that fail
- $ref->{waitt} = $main::systime + $waittime + rand(120) if $node ne $main::mycall;
- }
- }
-
# queue some message if the interval timer has gone off
queue_msg(0);
dbg('msg', "queue msg ($sort)\n");
my @nodelist = DXChannel::get_all_nodes;
foreach $ref (@msg) {
- # firstly, is it private and unread? if so can I find the recipient
- # in my cluster node list offsite?
# ignore 'delayed' messages until their waiting time has expired
if (exists $ref->{waitt}) {
delete $ref->{waitt};
}
+ # any time outs?
+ if (exists $ref->{lastt} && $main::systime >= $ref->{lastt} + $timeout) {
+ my $node = $ref->{tonode};
+ dbg('msg', "Timeout, stopping msgno: $ref->{msgno} -> $node");
+ Log('msg', "Timeout, stopping msgno: $ref->{msgno} -> $node");
+ $ref->stop_msg($node);
+
+ # delay any outgoing messages that fail
+ $ref->{waitt} = $main::systime + $waittime + rand(120) if $node ne $main::mycall;
+ delete $ref->{lastt};
+ next;
+ }
+
+ # firstly, is it private and unread? if so can I find the recipient
+ # in my cluster node list offsite?
+
# deal with routed private messages
my $dxchan;
if ($ref->{private}) {
use Time::HiRes qw(gettimeofday tv_interval);
use BadWords;
use DXHash;
+use Route::Node;
use strict;
use vars qw($me $pc11_max_age $pc23_max_age
confess $@ if $@;
$me->{sort} = 'S'; # S for spider
$me->{priv} = 9;
+ $Route::Node::me->adddxchan($me);
}
#
--- /dev/null
+#
+# Node routing routines
+#
+# Copyright (c) 2001 Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+package Route::Node;
+
+use DXDebug;
+use Route;
+
+use strict;
+
+use vars qw(%list %valid @ISA $me);
+@ISA = qw(Route);
+
+%valid = (
+ dxchancall => '0,DXChannel Calls,parray',
+ parent => '0,Parent Calls,parray',
+ version => '0,Version',
+);
+
+%list = ();
+
+sub init
+{
+ $me = Route::Node->new(@_);
+}
+
+sub new
+{
+ my $pkg = shift;
+ my $call = uc shift;
+ confess "already have $call in $pkg" if $list{$call};
+
+ my $self = $pkg->SUPER::new($call);
+ $self->{dxchancall} = [ ];
+ $self->{parent} = [ ];
+ $self->{version} = shift;
+
+ $list{$call} = $self;
+
+ return $self;
+}
+
+sub get
+{
+ my $call = shift;
+ $call = shift if ref $call;
+ return $list{uc $call};
+}
+
+sub adddxchan
+{
+ my $self = shift;
+ $self->_addlist('dxchancall', @_);
+}
+
+sub deldxchan
+{
+ my $self = shift;
+ $self->_dellist('dxchancall', @_);
+}
+
+sub addparent
+{
+ my $self = shift;
+ $self->_addlist('parent', @_);
+}
+
+sub delparent
+{
+ my $self = shift;
+ $self->_dellist('parent', @_);
+}
+
+1;
+
--- /dev/null
+#
+# User routing routines
+#
+# Copyright (c) 2001 Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+package Route::User;
+
+use DXDebug;
+use Route;
+
+use strict;
+
+use vars qw(%list %valid @ISA);
+@ISA = qw(Route);
+
+%valid = (
+ node => '0,Node Calls,parray',
+);
+
+%list = ();
+
+sub new
+{
+ my $pkg = shift;
+ my $call = uc shift;
+ confess "already have $call in $pkg" if $list{$call};
+
+ my $self = $pkg->SUPER::new($call);
+ $self->{node} = [ ];
+ $list{$call} = $self;
+
+ return $self;
+}
+
+sub get
+{
+ my $call = shift;
+ $call = shift if ref $call;
+ return $list{uc $call};
+}
+
+sub addnode
+{
+ my $self = shift;
+ $self->_addlist('node', @_);
+}
+
+sub delnode
+{
+ my $self = shift;
+ $self->_dellist('node', @_);
+}
+
+1;
use WCY;
use BadWords;
use Timer;
+use Route;
+use Route::Node;
+use Route::User;
use Data::Dumper;
use IO::File;
# initialise the protocol engine
dbg('err', "reading in duplicate spot and WWV info ...");
+Route::Node::init($mycall, $version);
DXProt->init();
# put in a DXCluster node for us here so we can add users and take them away