This should fix it ... ;-)
authorRoland Haeder <roland@mxchange.org>
Sun, 24 May 2015 21:10:58 +0000 (23:10 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 24 May 2015 21:10:58 +0000 (23:10 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
application/hub/main/discovery/recipient/package/class_PackageRecipientDiscovery.php
application/hub/main/handler/protocol/class_BaseProtocolHandler.php
core

index f878eb772814ea56433ece8853fb3302a16f7fab..72e8794004483b9de45848c955d72e877a53455d 100644 (file)
@@ -97,7 +97,7 @@ class PackageRecipientDiscovery extends BaseRecipientDiscovery implements Discov
                $handlerInstance = ProtocolHandlerFactory::createProtocolHandlerFromPackageData($decodedData);
 
                // Is the 'recipient' field same as this peer's IP?
-               if ($handlerInstance->isOwnAddress()) {
+               if ($handlerInstance->isOwnAddress($decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) {
                        /*
                         * Is same as own external address + TCP/UDP listen port or
                         * internal address, don't do anything here so other classes found
@@ -106,10 +106,10 @@ class PackageRecipientDiscovery extends BaseRecipientDiscovery implements Discov
                         */
 
                        // Debug output (may flood)
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient matches own ip (external=' .  HubTools::determineOwnExternalAddress() . ' or internal=' . HubTools::determineOwnInternalAddress() . ')');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient ' . $decodedData[NetworkPackage::PACKAGE_DATA_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)!');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient ' . $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' is different than own external address (' .  HubTools::determineOwnExternalAddress() . ') nor internal address (' . HubTools::determineOwnInternalAddress() . '), need to forward (not yet implemented)!');
 
                        // This package is to be delivered to someone else, so add it
                        // @TODO Unfinished: $this->getListInstance()->addEntry('unl', $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
index 3a840767adc4f447fef2f7ba3f79a20152d9b1c1..af5d37aa2698b591f90804edebb6205dcaa3a57d 100644 (file)
@@ -196,12 +196,10 @@ class BaseProtocolHandler extends BaseHandler {
        /**
         * If the found UNL (address) matches own external or internal address
         *
+        * @param       $unl            UNL to test
         * @return      $ifMatches      Whether the found UNL matches own addresss
         */
-       public function isOwnAddress () {
-               // Get current UNL (from universalNodeLocatorData array)
-               $currentUnl = $this->getCurrentUniversalNodeLocator();
-
+       public function isOwnAddress ($unl) {
                // Get own external UNL
                $externalUnl = HubTools::determineOwnExternalAddress();
 
@@ -209,11 +207,11 @@ class BaseProtocolHandler extends BaseHandler {
                $internalUnl = HubTools::determineOwnInternalAddress();
 
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: currentUnl=' . $currentUnl . ',externalUnl=' . $externalUnl . ',internalUnl=' . $internalUnl);
-               //* DIE-DEBUG: */ die(__METHOD__.':currentUnl=' . $currentUnl . ',this='.print_r($this, TRUE));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ',externalUnl=' . $externalUnl . ',internalUnl=' . $internalUnl);
+               //* DIE-DEBUG: */ die(__METHOD__.':unl=' . $unl . ',this='.print_r($this, TRUE));
 
                // Is it the same?
-               $ifMatches = (($currentUnl === $externalUnl) || ($currentUnl === $internalUnl));
+               $ifMatches = (($unl === $externalUnl) || ($unl === $internalUnl));
 
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: ifMatches=' . intval($ifMatches));
diff --git a/core b/core
index e10ada14e2f86607a9d165dac6f7fb154e0be4eb..90c5b8005aff620af19c89e0fba2ad1a9198683a 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit e10ada14e2f86607a9d165dac6f7fb154e0be4eb
+Subproject commit 90c5b8005aff620af19c89e0fba2ad1a9198683a