Add a feature switch to reachability

This commit is contained in:
2026-08-03 21:02:31 +02:00
parent 51d76cd451
commit 781c6047ca
2 changed files with 15 additions and 8 deletions
+13 -8
View File
@@ -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);