my @nodes = grep {$_->do_pc92 || $_->via_pc92} Route::Node::get_all();
my @rdel;
foreach my $n (@nodes) {
- if ($n->dec_obs <= 0) {
+ my $o = $n->dec_obs;
+ if ($o <= 0) {
if (my $dxchan = DXChannel::get($n->call)) {
- dbg("ROUTE: disconnecting local pc92 $_->{call} on obscount") if isdbg('route');
+ dbg("ROUTE: disconnecting local pc92 $dxchan->{call} on obscount") if isdbg('route');
$dxchan->disconnect;
next;
}
push @rdel, $n->del($_);
}
}
+ } else {
+ dbg("ROUTE: obscount on $n->{call} now $o") if isdbg('route');
}
}
for (@rdel) {
$parent->do_pc92(1);
$parent->via_pc92(1);
$parent->reset_obs;
+ dbg("ROUTE: reset obscount on $pcall now " . $parent->obscount) if isdbg('route');
+
if (@ent) {
dbg("PCPROT: no previous C or A for this external node received, ignored") if isdbg('chanerr');
return;
}
- my $parent = check_pc9x_t($call, $t, 92) || return;
+ $parent = check_pc9x_t($call, $t, 92) || return;
+ $parent->via_pc92(1);
+ $parent->reset_obs;
+ dbg("ROUTE: reset obscount on $pcall now " . $parent->obscount) if isdbg('route');
}
} else {
dbg("PCPROT: must be mycall or external node as first entry, ignored") if isdbg('chanerr');
$parent->here(Route::here($here));
$parent->version($version) if $version && $version > $parent->version;
$parent->build($build) if $build && $build > $parent->build;
- $parent->via_pc92(1);
- $parent->reset_obs;
shift @ent;
}