Make set/isolate work in BOTH directions
authorDirk Koopman <djk@tobit.co.uk>
Wed, 18 Jul 2007 16:04:46 +0000 (17:04 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Wed, 18 Jul 2007 16:04:46 +0000 (17:04 +0100)
Since the beginning I have had set/isolate be unidirection, so that I could
see the far node's config, but he could not see mine. This is too confusing
for yer modern sysop and I have now made it such that only the local configs
are remembered, regardless of what is sent back to me. I.e. it is now
symmetric and bidirectional.

Changes
perl/DXProt.pm
perl/DXProtHandle.pm
perl/Version.pm

diff --git a/Changes b/Changes
index 64a1dc1d2adf96839f6cf5afef79bd4615248892..45c6ea750c07026b127d36c61bd75d4a8469b0d5 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,10 @@
+18Jul07=======================================================================
+1. Change the meaning of set/isolate. Set/isolate now works in both directions
+in that an isolated node will only have its local config remembered and will
+only be sent this nodes local config. This is exactly equivalent to both
+ends setting set/isolate. If that is already the case then there should be
+no noticeable change. Any extra that the far node sends, over and above its
+local config will now be ignored.
 17Jul07=======================================================================
 1. remove dupefile on startup and on ending the node. Add clear/dupefile
 command to allow people to do it at runtime as well.
index e4e0aa49db77409adf7ee3cb097dffbf492f2ec7..712b478539c79973e47895fdcfc17a98a97e5952 100644 (file)
@@ -1238,6 +1238,12 @@ sub send_route
        for (; @_ && $no; $no--) {
                my $r = shift;
 
+               # don't send messages with $self's call in back to them
+               if ($r->call eq $self->{call}) {
+                       dbg("PCPROT: trying to send $self->{call} back itself") if isdbg('chanerr');
+                       next;
+               }
+
                if (!$self->{isolate} && $self->{routefilter}) {
                        $filter = undef;
                        if ($r) {
@@ -1314,8 +1320,9 @@ sub broadcast_route_nopc9x
                        next if $origin eq $dxchan->{call};     # don't route some from this call back again.
                        next unless $dxchan->isa('DXProt');
                        next if $dxchan->{do_pc9x};
-                       next if ($generate == \&pc16 || $generate==\&pc17) && !$dxchan->user->wantsendpc16;
-
+                       if ($generate == \&pc16 || $generate==\&pc17) {
+                               next unless $dxchan->user->wantsendpc16;
+                       }
                        $dxchan->send_route($origin, $generate, @_);
                }
        }
index eacd9225d7ca197a9c0acf4b3accbd9968574d35..cd229c0f2d113370a11869e7d06de450efc76edb 100644 (file)
@@ -405,6 +405,12 @@ sub handle_16
                return;
        }
 
+       # isolate now means only accept stuff from this call only
+       if ($self->{isolate} && $ncall ne $self->{call}) {
+               dbg("PCPROT: $self->{call} isolated, $ncall ignored") if isdbg('chanerr');
+               return;
+       }
+
        my $parent = Route::Node::get($ncall);
 
        if ($parent) {
@@ -503,6 +509,12 @@ sub handle_17
                return;
        }
 
+       # isolate now means only accept stuff from this call only
+       if ($self->{isolate} && $ncall ne $self->{call}) {
+               dbg("PCPROT: $self->{call} isolated, $ncall ignored") if isdbg('chanerr');
+               return;
+       }
+
        RouteDB::delete($ncall, $self->{call});
 
        my $uref = Route::User::get($ucall);
@@ -684,6 +696,12 @@ sub handle_19
                        }
                }
 
+               # isolate now means only accept stuff from this call only
+               if ($self->{isolate} && $call ne $self->{call}) {
+                       dbg("PCPROT: $self->{call} isolated, $call ignored") if isdbg('chanerr');
+                       next;
+               }
+
                my $user = check_add_node($call);
 
 #              if (eph_dup($genline)) {
@@ -787,11 +805,16 @@ sub handle_21
        eph_del_regex("^PC1[679].*$call");
 
        # if I get a PC21 from the same callsign as self then ignore it
-       if ($call eq $self->call) {
+       if ($call eq $self->{call}) {
                dbg("PCPROT: self referencing PC21 from $self->{call}");
                return;
        }
 
+       # for the above reason and also because of the check for PC21s coming
+       # in for self->call from outside being ignored further down
+       # we don't need any isolation code here, because we will never
+       # act on a PC21 with self->call in it.
+
        RouteDB::delete($call, $self->{call});
 
        my $parent = Route::Node::get($self->{call});
index db94a844e16089fa6341822eb829785b5755b42b..99bbd848ccce3d5d32ce3e6d8be0a34c6e977e77 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '119';
+$build = '120';
 
 1;