From ad158eb1bf31f5df370875907c8433a3ff80b3a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 7 Jul 2009 15:43:21 +0000 Subject: [PATCH] More debug lines added --- application/hub/init.php | 8 ++++---- .../hub/main/nodes/boot/class_HubBootNode.php | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/application/hub/init.php b/application/hub/init.php index 7b899fd96..944a222a7 100644 --- a/application/hub/init.php +++ b/application/hub/init.php @@ -36,17 +36,17 @@ $cfg = FrameworkConfiguration::getInstance(); // Initialize output system -require($cfg->readConfig('base_path') . "inc/output.php"); +require($cfg->readConfig('base_path') . 'inc/output.php'); // Initialize file i/o system -require($cfg->readConfig('base_path') . "inc/file_io.php"); +require($cfg->readConfig('base_path') . 'inc/file_io.php'); // Include the language sub-system -require($cfg->readConfig('base_path') . "inc/language.php"); +require($cfg->readConfig('base_path') . 'inc/language.php'); // This application needs a database connection then we have to simply include // the inc/database.php script -require($cfg->readConfig('base_path') . "inc/database.php"); +require($cfg->readConfig('base_path') . 'inc/database.php'); // Get's our IP address $_SERVER['SERVER_ADDR'] = ConsoleTools::acquireSelfIPAddress(); diff --git a/application/hub/main/nodes/boot/class_HubBootNode.php b/application/hub/main/nodes/boot/class_HubBootNode.php index b984b5ce8..0311315c7 100644 --- a/application/hub/main/nodes/boot/class_HubBootNode.php +++ b/application/hub/main/nodes/boot/class_HubBootNode.php @@ -65,25 +65,31 @@ class HubBootNode extends BaseHubNode implements NodeHelper { parent::doGenericBootstrapping(); // Now check if the IP address matches one of the bootstrap nodes - if ($this->ifAddressMatchesBootstrappingNodes($_SERVER['REMOTE_ADDR'])) { + if ($this->ifAddressMatchesBootstrappingNodes($_SERVER['SERVER_ADDR'])) { // Get our port from configuration $ourPort = $this->getConfigInstance()->readConfig('node_listen_port'); // Is the port the same? if (substr($this->bootIpPort, -strlen($ourPort), strlen($ourPort)) == $ourPort) { // It is the same! - $this->getDebugInstance()->output(__FUNCTION__.'['.__LINE__.']: IP/port matches bootstrapping node ' . $this->bootIpPort . '.'); + $this->getDebugInstance()->output('BOOTSTRAP: IP/port matches bootstrapping node ' . $this->bootIpPort . '.'); // Now, does the mode match (should be 'boot'!) if ($this->getRequestInstance()->getRequestElement('mode') == 'boot') { // Output debug message - $this->getDebugInstance()->output(__FUNCTION__.'['.__LINE__.']: Our node is a valid bootstrapping node.'); + $this->getDebugInstance()->output('BOOTSTRAP: Our node is a valid bootstrapping node.'); } else { // Output warning - $this->getDebugInstance()->output(__FUNCTION__.'['.__LINE__.']: WARNING! Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=boot detected.'); + $this->getDebugInstance()->output('BOOTSTRAP: WARNING: Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=boot detected.'); } - } // END - if - } // END - if + } else { + // IP does match, but no port + $this->getDebugInstance()->output('BOOTSTRAP: WARNING: Our IP ' . $_SERVER['SERVER_ADDR'] . ' does match a known bootstrap-node but not the port ' . $ourPort . '.'); + } + } else { + // Node does not match any know bootstrap-node + $this->getDebugInstance()->output('BOOTSTRAP: WARNING: Our IP ' . $_SERVER['SERVER_ADDR'] . ' does not match any known bootstrap-nodes.'); + } // This might not be all... $this->partialStub('Please implement more bootsrapping steps.'); -- 2.39.2