|
|
@@ -836,6 +836,11 @@ sub add_server
|
|
|
my ($domainpattern) = '\.[^:]+';
|
|
|
my ($i);
|
|
|
|
|
|
+ for ($i = 0; $i <= $#servers; $i++) {
|
|
|
+ return $i if ($servers[$i] =~ /$host:\d*=$shadowport\D/i);
|
|
|
+ return $i if ($servers[$i] =~ /$host:$port\D/i);
|
|
|
+ }
|
|
|
+
|
|
|
# Remove the domain name from the host name
|
|
|
my ($hostnode) = $host;
|
|
|
$hostnode = $1 if $host =~ /^(.+?)\./;
|
|
|
@@ -872,11 +877,6 @@ sub add_server
|
|
|
$bindcert = $c if ($bindcert eq "" || $bindcert eq "*");
|
|
|
}
|
|
|
|
|
|
- for ($i = 0; $i <= $#servers; $i++) {
|
|
|
- return $i if ($servers[$i] =~ /$hostnode($domainpattern)*:\d*=$shadowport\D/i);
|
|
|
- return $i if ($servers[$i] =~ /$hostnode($domainpattern)*:$port\D/i);
|
|
|
- }
|
|
|
-
|
|
|
if ($shadowport) {
|
|
|
push (@servers, "$host:$port=$shadowport:$binddn:$bindpwd:$bindcert");
|
|
|
} else {
|