X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl%2Fcluster.pl;h=d7dd9a0c4fb2469fdd95241c70749e3429491fe5;hb=495e620d66fbc1b8c64dd65ff8d89fc43a2e6f08;hp=c517a23179d9d2eb35c8849bde6d57490bca12e0;hpb=7b9256ceade8b18b48f848c9ac659c2de7322b0b;p=spider.git diff --git a/perl/cluster.pl b/perl/cluster.pl index c517a231..d7dd9a0c 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -118,12 +118,13 @@ use vars qw(@inqueue $systime $starttime $lockfn @outstanding_connects $zombies $root @listeners $lang $myalias @debug $userfn $clusteraddr $clusterport $mycall $decease $is_win $routeroot $me $reqreg $bumpexisting $allowdxby $dbh $dsn $dbuser $dbpass $do_xml $systime_days $systime_daystart + $can_encode ); @inqueue = (); # the main input queue, an array of hashes $systime = 0; # the time now (in seconds) $starttime = 0; # the starting time of the cluster -#@outstanding_connects = (); # list of outstanding connects +@outstanding_connects = (); # list of outstanding connects @listeners = (); # list of listeners $reqreg = 0; # 1 = registration required, 2 = deregister people $bumpexisting = 1; # 1 = allow new connection to disconnect old, 0 - don't allow it @@ -344,6 +345,19 @@ if (DXSql::init($dsn)) { $dbh = $dbh->connect($dsn, $dbuser, $dbpass) if $dbh; } +# try to load Encode +{ + no warnings; + my $w = $SIG{__DIE__}; + $SIG{__DIE__} = 'IGNORE'; + eval { require Encode; }; + unless ($@) { + import Encode; + $can_encode = 1; + } + $SIG{__DIE__} = $w; +} + # try to load XML::Simple DXXml::init();