Add a feature switch to reachability
This commit is contained in:
@@ -30,16 +30,21 @@ if ($error_reporting) {
|
||||
|
||||
$reachable = false;
|
||||
if (isset($_GET["new"])) {
|
||||
require "enet_probe.php";
|
||||
$host = $_SERVER['REMOTE_ADDR'];
|
||||
if (!empty($_GET["host"])) {
|
||||
$host = $_GET["host"];
|
||||
if ($check_reachability) {
|
||||
require "enet_probe.php";
|
||||
$host = $_SERVER['REMOTE_ADDR'];
|
||||
if (!empty($_GET["host"])) {
|
||||
$host = $_GET["host"];
|
||||
}
|
||||
$port = 50403;
|
||||
if (!empty($_GET["port"]) && is_numeric($_GET["port"])) {
|
||||
$port = intval($_GET["port"]);
|
||||
}
|
||||
$reachable = enet_probe($host, $port);
|
||||
}
|
||||
$port = 50403;
|
||||
if (!empty($_GET["port"]) && is_numeric($_GET["port"])) {
|
||||
$port = intval($_GET["port"]);
|
||||
else {
|
||||
$reachable = true;
|
||||
}
|
||||
$reachable = enet_probe($host, $port);
|
||||
}
|
||||
|
||||
$dirname = dirname($state_file);
|
||||
|
||||
Reference in New Issue
Block a user