fix DXVars.pm overrides line $clusterport
authorDirk Koopman <djk@tobit.co.uk>
Sun, 2 Jan 2022 23:24:39 +0000 (23:24 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Sun, 2 Jan 2022 23:24:39 +0000 (23:24 +0000)
This is only of use for the paranoid and people running more than
one instance of DXSpider on one machine.

Changes
perl/cluster.pl
perl/console.pl

diff --git a/Changes b/Changes
index 210f782a67ead2fd4e5b0187a2e2d6a2bf0e23c7..1264c27535160f1bd31dfb9d65393a103315762e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+03Jan22=======================================================================
+1. Allow overrides (on modern versions of perl) with things in DXVars.pm, such
+   $clusterport. This is really only of use for people trying to run more than
+   one instance of DXSpider on the same machine.
 02Jan22=======================================================================
 1. Fix dx bug introduced to handle dx by ip <ipaddr> for webclusters.
 2. Remove _add_thingy dbg message from general view.
index ffdfa42df1fd691acca53f4ed674a8c48cc8032c..d62b88b10840e291033e627f10b3e037b90b5698 100755 (executable)
@@ -12,7 +12,7 @@
 
 package main;
 
-require 5.10.1;
+require 5.16.1;
 
 use warnings;
 
@@ -21,15 +21,15 @@ use vars qw($root $is_win $systime $lockfn @inqueue $starttime $lockfn @outstand
                        $clusterport $mycall $decease $routeroot $me $reqreg $bumpexisting
                        $allowdxby $dbh $dsn $dbuser $dbpass $do_xml $systime_days $systime_daystart
                        $can_encode $maxconnect_user $maxconnect_node $idle_interval $log_flush_interval
-                       $broadcast_debug 
+                       $broadcast_debug $yes $no $user_interval
                   );
 
-$lang = 'en';                                  # default language
-$clusteraddr = '127.0.0.1';            # cluster tcp host address - used for things like console.pl
-$clusterport = 27754;                  # cluster tcp port
-$yes = 'Yes';                                  # visual representation of yes
-$no = 'No';                                            # ditto for no
-$user_interval = 11*60;                        # the interval between unsolicited prompts if no traffic
+#$lang = 'en';                                 # default language
+#$clusteraddr = '127.0.0.1';           # cluster tcp host address - used for things like console.pl
+#$clusterport = 27754;                 # cluster tcp port
+#$yes = 'Yes';                                 # visual representation of yes
+#$no = 'No';                                           # ditto for no
+#$user_interval = 11*60;                       # the interval between unsolicited prompts if no traffic
 
 # make sure that modules are searched in the order local then perl
 BEGIN {
@@ -166,6 +166,13 @@ use strict;
 
 use Local;
 
+$lang //= 'en';                                        # default language
+$clusteraddr //= '127.0.0.1';   # cluster tcp host address - used for things like console.pl
+$clusterport //= 27754;                        # cluster tcp port
+$yes //= 'Yes';                                        # visual representation of yes
+$no //= 'No';                              # ditto for no
+$user_interval //= 11*60;              # the interval between unsolicited prompts if no traffic
+
 
 @inqueue = ();                                 # the main input queue, an array of hashes
 $systime = 0;                                  # the time now (in seconds)
index 7e725029b0fb79919dcf7dfda141aef98b2f3602..32c6cf5f109d9e2cd6911d5ece1ebe6634640b27 100755 (executable)
@@ -27,8 +27,6 @@ BEGIN {
        $is_win = ($^O =~ /^MS/ || $^O =~ /^OS-2/) ? 1 : 0; # is it Windows?
 }
 
-$clusteraddr = '127.0.0.1';
-$clusterport = 27754;
 
 use Mojo::IOLoop;
 
@@ -51,6 +49,9 @@ use Console;
 # initialisation
 #
 
+$clusteraddr //= '127.0.0.1';
+$clusterport //= 27754;
+
 $call = "";                     # the callsign being used
 $node = "";                     # the node callsign being used
 $conn = 0;                      # the connection object for the cluster