From 9a027eefde35e7486e1b31b0d736cb04b4e36306 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 18 Feb 2015 18:35:12 +0100 Subject: [PATCH] Improved some comments + added commented-out debug lines. Signed-off-by: Roland Haeder --- .../package/class_PackageRecipientDiscovery.php | 2 +- application/hub/main/tools/class_HubTools.php | 17 ++++++++++++++++- .../hub/templates/xml/dht_publish/publish.xml | 3 +-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/application/hub/main/discovery/recipient/package/class_PackageRecipientDiscovery.php b/application/hub/main/discovery/recipient/package/class_PackageRecipientDiscovery.php index 27baacd2c..ea025fcf1 100644 --- a/application/hub/main/discovery/recipient/package/class_PackageRecipientDiscovery.php +++ b/application/hub/main/discovery/recipient/package/class_PackageRecipientDiscovery.php @@ -106,7 +106,7 @@ class PackageRecipientDiscovery extends BaseRecipientDiscovery implements Discov */ // Debug output (may flood) - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient matches own ip (' . HubTools::determineOwnExternalAddress() . ' or ' . HubTools::determineOwnInternalAddress() . ')'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient matches own ip (external=' . HubTools::determineOwnExternalAddress() . ' or internal=' . HubTools::determineOwnInternalAddress() . ')'); } else { // Debug output (may flood) /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient is different than own external address (' . HubTools::determineOwnExternalAddress() . ') nor internal address (' . HubTools::determineOwnInternalAddress() . '), need to forward (not yet implemented)!'); diff --git a/application/hub/main/tools/class_HubTools.php b/application/hub/main/tools/class_HubTools.php index 71fb229ba..e5017a0b4 100644 --- a/application/hub/main/tools/class_HubTools.php +++ b/application/hub/main/tools/class_HubTools.php @@ -210,18 +210,33 @@ class HubTools extends BaseHubSystem { * @return $unl The determined internal UNL of this node */ public static function determineOwnInternalAddress () { + // Debug message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + // Is the internal_address config entry set? if (FrameworkConfiguration::getSelfInstance()->getConfigEntry('allow_publish_internal_address') == 'N') { + // Debug message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Calling self::determineOwnExternalAddress() as allow_publish_internal_address=N is set ...'); + // Not allowed to publish internal address, so use external $unl = self::determineOwnExternalAddress(); } elseif (FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_address') != '') { + // Debug message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Getting config entry internal_address ...'); + // Use it as internal address $unl = FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_address'); } else { - // Determine own internal address by connecting to my (coder) server at 188.138.90.169 + // Debug message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Calling self::determineInternalUniversalNodeLocator() ...'); + + // Determine own internal address $unl = self::determineInternalUniversalNodeLocator(); } + // Debug message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ' - EXIT!'); + // Return it return $unl; } diff --git a/application/hub/templates/xml/dht_publish/publish.xml b/application/hub/templates/xml/dht_publish/publish.xml index 156f0d249..811381e3b 100644 --- a/application/hub/templates/xml/dht_publish/publish.xml +++ b/application/hub/templates/xml/dht_publish/publish.xml @@ -37,8 +37,7 @@ along with this program. If not, see Array ( [node_mode] => regular - [external_address] => 192.168.2.3 - [listen_port] => 9061 + [external_address] => tcp://192.168.2.3:9060 [node_id] => 38fc625d3d9aa05654bfc90a7aea7ff72c883f1573 [session_id] => 38fc625d3dabe9ff09b54253b298e91985191472a3 [private_key_hash] => 38fc625d3dad67db034d7e715fae8b8ea47fefb0dc -- 2.39.5