try to prevent double connects from semi succeeding and then getting an
[spider.git] / perl / cluster.pl
index d3feaa39c813c7936d72fca0abd4a1cdac6ee12a..d321cba5fcd9b971e4cb048857aa539065daa253 100755 (executable)
@@ -69,6 +69,7 @@ use DXDb;
 use DXHash;
 use DXDupe;
 use Prefix;
+use Spot;
 use Bands;
 use Keps;
 use Minimuf;
@@ -99,7 +100,7 @@ use vars qw(@inqueue $systime $version $starttime $lockfn @outstanding_connects
 
 @inqueue = ();                                 # the main input queue, an array of hashes
 $systime = 0;                                  # the time now (in seconds)
-$version = "1.47";                             # the version no of the software
+$version = "1.48";                             # the version no of the software
 $starttime = 0;                 # the starting time of the cluster   
 #@outstanding_connects = ();     # list of outstanding connects
 @listeners = ();                               # list of listeners
@@ -109,7 +110,8 @@ $starttime = 0;                 # the starting time of the cluster
 sub already_conn
 {
        my ($conn, $call, $mess) = @_;
-       
+
+       $conn->disable_read(1);
        dbg('chan', "-> D $call $mess\n"); 
        $conn->send_now("D$call|$mess");
        sleep(2);
@@ -146,7 +148,7 @@ sub new_channel
                        ;
                } else {
                        if (my $ref = DXCluster->get_exact($call)) {
-                               my $mess = DXM::msg($lang, 'concluster', $call, $ref->mynode->call);
+                               my $mess = DXM::msg($lang, 'concluster', $call, $ref->mynode->dxchancall);
                                already_conn($conn, $call, $mess);
                                return;
                        }
@@ -154,7 +156,7 @@ sub new_channel
                $user->{lang} = $main::lang if !$user->{lang}; # to autoupdate old systems
        } else {
                if (my $ref = DXCluster->get_exact($call)) {
-                       my $mess = DXM::msg($lang, 'concluster', $call, $ref->mynode->call);
+                       my $mess = DXM::msg($lang, 'concluster', $call, $ref->mynode->dxchancall);
                        already_conn($conn, $call, $mess);
                        return;
                }