From 88b6efa6cf202aea9ced307dac08089ecbc7a2fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 26 Oct 2020 11:13:01 +0100 Subject: [PATCH] Continued: - recipientType was used in an ambicious way: type != UNL MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../socket/class_SocketContainer.php | 6 ++--- .../protocol/class_ProtocolDiscovery.php | 2 +- .../class_PackageRecipientDiscovery.php | 12 +++++----- .../socket/class_PackageSocketDiscovery.php | 4 ++-- .../factories/socket/class_SocketFactory.php | 2 +- .../package/class_NetworkPackageHandler.php | 15 +++++------- .../ipv4/class_BaseIpV4ProtocolHandler.php | 8 +++---- .../raw_data/class_BaseRawDataHandler.php | 2 +- .../ipv4/tcp/class_TcpConnectionHelper.php | 18 +++++++++----- .../classes/listener/class_BaseListener.php | 4 ++-- .../package/deliverable/class_PackageData.php | 24 +++++++++++++++++++ .../fragmenter/class_PackageFragmenter.php | 2 +- .../registry/socket/class_SocketRegistry.php | 2 +- .../tags/package/class_PackageTags.php | 1 + ...class_UnexpectedPackageStatusException.php | 4 ++-- .../unl/class_InvalidUnlException.php | 4 ++-- 16 files changed, 69 insertions(+), 41 deletions(-) diff --git a/application/hub/classes/container/socket/class_SocketContainer.php b/application/hub/classes/container/socket/class_SocketContainer.php index 5ef1b3cb0..fed990f13 100644 --- a/application/hub/classes/container/socket/class_SocketContainer.php +++ b/application/hub/classes/container/socket/class_SocketContainer.php @@ -182,7 +182,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($this->getSocketProtocol()) . '-SOCKET: unl=' . $unl . ',packageInstance=' . print_r($packageInstance, true)); // So, does both match? - $matches = (($packageInstance->getRecipientType() !== '') && ($packageInstance->getRecipientType() === $unl)); + $matches = (($packageInstance->getRecipientUnl() !== '') && ($packageInstance->getRecipientUnl() === $unl)); // Trace message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: matches=%d - EXIT!', strtoupper($this->getSocketProtocol()), intval($matches))); @@ -346,10 +346,10 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita $packageInstance = $this->getPackageDataInstance(); // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: packageInstance.recipient=%s - EXIT!', strtoupper($this->getSocketProtocol()), $packageInstance->getRecipientType())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: packageInstance.recipient=%s - EXIT!', strtoupper($this->getSocketProtocol()), $packageInstance->getRecipientUnl())); // Return it - return $packageInstance->getRecipientType(); + return $packageInstance->getRecipientUnl(); } /** diff --git a/application/hub/classes/discovery/protocol/class_ProtocolDiscovery.php b/application/hub/classes/discovery/protocol/class_ProtocolDiscovery.php index 333320336..ed01b2369 100644 --- a/application/hub/classes/discovery/protocol/class_ProtocolDiscovery.php +++ b/application/hub/classes/discovery/protocol/class_ProtocolDiscovery.php @@ -94,7 +94,7 @@ class ProtocolDiscovery extends BaseNodeDiscovery implements DiscoverableProtoco * "Explode" the 'recipient' array element into a new one, giving at * least two entries: protocol://address */ - $recipient = explode(':', $packageInstance->getRecipientType()); + $recipient = explode(':', $packageInstance->getRecipientUnl()); // At least 2 entries must be found assert(count($recipient) >= 2); diff --git a/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php b/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php index 881e99ab5..29edd20f1 100644 --- a/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php +++ b/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php @@ -80,7 +80,7 @@ class PackageRecipientDiscovery extends BaseRecipientDiscovery implements Discov * recipient must be direct recipient then, otherwise a "virtual" * recipient. */ - if (NodeLocatorUtils::isValidUniversalNodeLocator($packageInstance->getRecipientType())) { + if (NodeLocatorUtils::isValidUniversalNodeLocator($packageInstance->getRecipientUnl())) { // Get instance (should not break) $recipientInstance = ObjectFactory::createObjectByConfiguredName('direct_recipient_class'); } else { @@ -89,7 +89,7 @@ class PackageRecipientDiscovery extends BaseRecipientDiscovery implements Discov } // Try to solve it - $recipientInstance->resolveRecipient($packageInstance->getRecipientType(), $this->getListInstance(), $packageInstance); + $recipientInstance->resolveRecipient($packageInstance->getRecipientUnl(), $this->getListInstance(), $packageInstance); } catch (FrameworkException $e) { // Could not find class, what ever failed $this->debugInstance(sprintf('[%s:%d]: Exception: %s,message=%s', __METHOD__, __LINE__, $e->__toString(), $e->getMessage())); @@ -112,7 +112,7 @@ class PackageRecipientDiscovery extends BaseRecipientDiscovery implements Discov $handlerInstance = ProtocolHandlerFactory::createProtocolHandlerFromPackageInstance($packageInstance); // Is the 'recipient' field same as this peer's IP? - if ($handlerInstance->isOwnAddress($packageInstance->getRecipientType())) { + if ($handlerInstance->isOwnAddress($packageInstance->getRecipientUnl())) { /* * Is same as own external address + TCP/UDP listen port or * internal address, don't do anything here so other classes found @@ -121,13 +121,13 @@ class PackageRecipientDiscovery extends BaseRecipientDiscovery implements Discov */ // Debug output (may flood) - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RECIPIENT-DISCOVERY: Recipient ' . $packageInstance->getRecipientType() . ' matches own ip (external=' . HubTools::determineOwnExternalAddress() . ' or internal=' . HubTools::determineOwnInternalAddress() . ')'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RECIPIENT-DISCOVERY: Recipient ' . $packageInstance->getRecipientUnl() . ' matches own ip (external=' . HubTools::determineOwnExternalAddress() . ' or internal=' . HubTools::determineOwnInternalAddress() . ')'); } else { // Debug output (may flood) - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RECIPIENT-DISCOVERY: Recipient ' . $packageInstance->getRecipientType() . ' is different than own external address (' . HubTools::determineOwnExternalAddress() . ') nor internal address (' . HubTools::determineOwnInternalAddress() . '), need to forward (not yet implemented)!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RECIPIENT-DISCOVERY: Recipient ' . $packageInstance->getRecipientUnl() . ' 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', $packageInstance->getRecipientType()); + // @TODO Unfinished: $this->getListInstance()->addEntry('unl', $packageInstance->getRecipientUnl()); } } diff --git a/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php b/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php index 1384a7111..9c8e0d7ac 100644 --- a/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php +++ b/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php @@ -207,7 +207,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera // Try to create a new socket resource try { // Possibly noisy debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-SOCKET-DISCOVERY: Trying to establish a ' . strtoupper($listenerInstance->getProtocolName()) . ' connection to ' . $packageInstance->getRecipientType() . ' ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-SOCKET-DISCOVERY: Trying to establish a ' . strtoupper($listenerInstance->getProtocolName()) . ' connection to ' . $packageInstance->getRecipientUnl() . ' ...'); // Get a socket resource from our factory (if succeeded) $socketInstance = SocketFactory::createSocketFromPackageInstance($packageInstance, $protocolInstance); @@ -229,7 +229,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera PeerStateResolver::resolveStateByPackage($helperInstance, $packageInstance, $socketInstance); } catch (InvalidSocketException $e) { // This cannot be fixed, so log it away - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-SOCKET-DISCOVERY: Cannot discover socket resource for recipient ' . $packageInstance->getRecipientType() . ': ' . $e->getMessage()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-SOCKET-DISCOVERY: Cannot discover socket resource for recipient ' . $packageInstance->getRecipientUnl() . ': ' . $e->getMessage()); // Make any failed attempts to 'FALSE' $socketInstance = NULL; diff --git a/application/hub/classes/factories/socket/class_SocketFactory.php b/application/hub/classes/factories/socket/class_SocketFactory.php index 3532935b4..9ddf52870 100644 --- a/application/hub/classes/factories/socket/class_SocketFactory.php +++ b/application/hub/classes/factories/socket/class_SocketFactory.php @@ -68,7 +68,7 @@ class SocketFactory extends ObjectFactory { $socketInstance = NULL; // Construct registry key - $registryKey = 'socket_' . $protocolInstance->getProtocolName() . '_' . $packageInstance->getRecipientType(); + $registryKey = sprintf('socket_%s_%s', $protocolInstance->getProtocolName(), $packageInstance->getRecipientType()); // Debug message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY: Trying to find a socket with registryKey=' . $registryKey); diff --git a/application/hub/classes/handler/package/class_NetworkPackageHandler.php b/application/hub/classes/handler/package/class_NetworkPackageHandler.php index 3416e41b4..621c0423d 100644 --- a/application/hub/classes/handler/package/class_NetworkPackageHandler.php +++ b/application/hub/classes/handler/package/class_NetworkPackageHandler.php @@ -570,17 +570,13 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei // Get current entry $currentRecipient = $iteratorInstance->current(); - // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Setting recipient to ' . $currentRecipient . ',previous=' . $packageInstance->getRecipientType()); - // Set the recipient - $packageInstance->setRecipient($currentRecipient); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Setting recipient to ' . $currentRecipient . ',previous=' . $packageInstance->getRecipientUnl()); + $packageInstance->setRecipientUnl($currentRecipient); // Push the declared package to the next stack. $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECLARED, $packageInstance); - - // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Package declared for recipient ' . $currentRecipient); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Package declared for recipient ' . $currentRecipient); // Skip to next entry $iteratorInstance->next(); @@ -1372,14 +1368,15 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei */ public function decodeRawContent ($rawPackageContent) { // Use the separator '#' to "decode" it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: rawPackageContent()=%d - CALLED!', strlen($rawPackageContent))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: rawPackageContent()=%d - CALLED!', strlen($rawPackageContent))); $decodedArray = explode(self::PACKAGE_DATA_SEPARATOR, $rawPackageContent); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: decodedArray=' . print_r($decodedArray, TRUE)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: decodedArray=' . print_r($decodedArray, TRUE)); // Assert on count (should be always 3) assert(count($decodedArray) == self::DECODED_DATA_ARRAY_SIZE); + /* PRINTR-DEBUG: */ die(sprintf('[%s:%d] decodedArray=%s', __METHOD__, __LINE__, print_r($decodedArray, TRUE))); // Create package instance $packageInstance = PackageDataFactory::createPackageDataInstance(); diff --git a/application/hub/classes/handler/protocol/ipv4/class_BaseIpV4ProtocolHandler.php b/application/hub/classes/handler/protocol/ipv4/class_BaseIpV4ProtocolHandler.php index e1de79c23..f289c729d 100644 --- a/application/hub/classes/handler/protocol/ipv4/class_BaseIpV4ProtocolHandler.php +++ b/application/hub/classes/handler/protocol/ipv4/class_BaseIpV4ProtocolHandler.php @@ -82,18 +82,18 @@ abstract class BaseIpV4ProtocolHandler extends BaseProtocolHandler { //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('IPV4-PROTOCOL-HANDLER: CALLED!'); // Is the correct handler choosen? - assert(substr($packageInstance->getRecipientType(), 0, strlen($this->getHandlerName())) != $this->getHandlerName()); + assert(substr($packageInstance->getRecipientUnl(), 0, strlen($this->getHandlerName())) != $this->getHandlerName()); // Default is from generic validation - $isValid = NodeLocatorUtils::isValidUniversalNodeLocator($packageInstance->getRecipientType()); + $isValid = NodeLocatorUtils::isValidUniversalNodeLocator($packageInstance->getRecipientUnl()); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('IPV4-PROTOCOL-HANDLER: packageInstance.recipient=' . $packageInstance->getRecipientType() . ',isValid[' . gettype($isValid) . ']=' . intval($isValid)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('IPV4-PROTOCOL-HANDLER: packageInstance.recipient=' . $packageInstance->getRecipientUnl() . ',isValid[' . gettype($isValid) . ']=' . intval($isValid)); // If this doesn't fail, continue validating the IP:port combination if ($isValid === TRUE) { // ... and validate IP:port, first "parse" the UNL - $unlInstance = UniversalNodeLocatorFactory::createUnlInstanceFromString($packageInstance->getRecipientType()); + $unlInstance = UniversalNodeLocatorFactory::createUnlInstanceFromString($packageInstance->getRecipientUnl()); // Set whole UNL instance // @TODO don't do this in a isValidFoo() method diff --git a/application/hub/classes/handler/raw_data/class_BaseRawDataHandler.php b/application/hub/classes/handler/raw_data/class_BaseRawDataHandler.php index 69f44a6f0..576e85c81 100644 --- a/application/hub/classes/handler/raw_data/class_BaseRawDataHandler.php +++ b/application/hub/classes/handler/raw_data/class_BaseRawDataHandler.php @@ -151,7 +151,7 @@ abstract class BaseRawDataHandler extends BaseHubHandler implements HandleableRa $ownAddress = NodeObjectFactory::createNodeInstance()->determineUniversalNodeLocator(); // Does it match? - $matches = ($ownAddress === $packageInstance->getRecipientType()); + $matches = ($ownAddress === $packageInstance->getRecipientUnl()); // Trace message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-DATA-HANDLER: matches=%d - EXIT!', intval($matches))); diff --git a/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php b/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php index 68038e271..90edd763d 100644 --- a/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php +++ b/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php @@ -85,23 +85,23 @@ class TcpConnectionHelper extends BaseIpV4ConnectionHelper implements Connection $helperInstance->setHandlerInstance($handlerInstance); } catch (NoValidHostnameException $e) { // Debug message - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Failed to resolve ' . $packageInstance->getRecipientType() . ':' . $e->getMessage()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Failed to resolve ' . $packageInstance->getRecipientUnl() . ':' . $e->getMessage()); // Is the recipient equal as configured UNL? - if (substr($packageInstance->getRecipientType(), 0, strlen($helperInstance->getConfigInstance()->getConfigEntry('external_address'))) == $helperInstance->getConfigInstance()->getConfigEntry('external_address')) { + if (substr($packageInstance->getRecipientUnl(), 0, strlen($helperInstance->getConfigInstance()->getConfigEntry('external_address'))) == $helperInstance->getConfigInstance()->getConfigEntry('external_address')) { // This may connect to shipsimu.org and requests 'ip.php' which will return our external IP address $unlAddress = HubTools::determineExternalAddress(); // Do we have ip:port match? // @TODO Rewrite this test for UNLs - if (strpos($packageInstance->getRecipientType(), ':') === FALSE) { + if (strpos($packageInstance->getRecipientUnl(), ':') === FALSE) { // No ip:port! - $helperInstance->debugInstance(sprintf('[%s:%d]: recipient=%s does not contain ":". Please fix this.', __METHOD__, __LINE__, $packageInstance->getRecipientType())); + $helperInstance->debugInstance(sprintf('[%s:%d]: recipient=%s does not contain ":". Please fix this.', __METHOD__, __LINE__, $packageInstance->getRecipientUnl())); } // END - if // "explode" the ip:port, so index 1 will be the port number // @TODO Rewrite this test for UNLs - $recipientArray = explode(':', $packageInstance->getRecipientType()); + $recipientArray = explode(':', $packageInstance->getRecipientUnl()); // Add the port $unlPort = $recipientArray[LocateableNode::UNL_PART_PORT]; @@ -111,7 +111,13 @@ class TcpConnectionHelper extends BaseIpV4ConnectionHelper implements Connection //$unlInstance =; } else { // It doesn't match, we need to take care of this later - $helperInstance->debugInstance(sprintf('[%s:%d]: recipient=%s!=%s', __METHOD__, __LINE__, $packageInstance->getRecipientType(), $helperInstance->getConfigInstance()->getConfigEntry('external_address'))); + $helperInstance->debugInstance(sprintf( + '[%s:%d]: recipient=%s!=%s', + __METHOD__, + __LINE__, + $packageInstance->getRecipientUnl(), + $helperInstance->getConfigInstance()->getConfigEntry('external_address') + )); } } diff --git a/application/hub/classes/listener/class_BaseListener.php b/application/hub/classes/listener/class_BaseListener.php index e4baf86c7..a57e8c3e4 100644 --- a/application/hub/classes/listener/class_BaseListener.php +++ b/application/hub/classes/listener/class_BaseListener.php @@ -405,7 +405,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { // Set all required data $socketInstance->setSenderAddres($peerAddress . $peerSuffix); $socketInstance->setSenderPort($peerPort); - $socketInstance->setRecipient($nodeInstance->getSessionId()); + $socketInstance->setRecipientId($nodeInstance->getSessionId()); $socketInstance->setStatus(NetworkPackageHandler::PACKAGE_STATUS_FAKED); die(__METHOD__.': UNFINISHED!'); @@ -436,7 +436,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { $socketProtocol = $this->getSocketInstance()->getSocketProtocol(); // Get UNL instance - $unlInstance = UniversalNodeLocatorFactory::createUnlInstanceFromString($packageInstance->getRecipientType()); + $unlInstance = UniversalNodeLocatorFactory::createUnlInstanceFromString($packageInstance->getRecipientUnl()); // Get protocol from it $unlProtocol = $unlInstance->getUnlProtocol(); diff --git a/application/hub/classes/package/deliverable/class_PackageData.php b/application/hub/classes/package/deliverable/class_PackageData.php index 7958b8379..badb7b7eb 100644 --- a/application/hub/classes/package/deliverable/class_PackageData.php +++ b/application/hub/classes/package/deliverable/class_PackageData.php @@ -62,6 +62,11 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera */ private $recipientType; + /** + * Recipient UNL + */ + private $recipientUnl; + /** * Status */ @@ -190,6 +195,25 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera $this->recipientType = $recipientType; } + /** + * Getter for recipient UNL + * + * @return $recipientUnl Recipient UNL + */ + public function getRecipientUnl () { + return $this->recipientUnl; + } + + /** + * Setter for recipient UNL + * + * @param $recipientUnl Recipient UNL + * @return void + */ + public function setRecipientUnl ($recipientUnl) { + $this->recipientUnl = $recipientUnl; + } + /** * Getter for status * diff --git a/application/hub/classes/package/fragmenter/class_PackageFragmenter.php b/application/hub/classes/package/fragmenter/class_PackageFragmenter.php index 9876361e3..837c88b98 100644 --- a/application/hub/classes/package/fragmenter/class_PackageFragmenter.php +++ b/application/hub/classes/package/fragmenter/class_PackageFragmenter.php @@ -173,7 +173,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera private function getProcessedPackagesIndex (DeliverablePackage $packageInstance) { return ( $packageInstance->getSenderAddress() . NetworkPackageHandler::PACKAGE_DATA_SEPARATOR . - $packageInstance->getRecipientType() . NetworkPackageHandler::PACKAGE_DATA_SEPARATOR . + $packageInstance->getRecipientUnl() . NetworkPackageHandler::PACKAGE_DATA_SEPARATOR . $packageInstance->getPackageContent() . NetworkPackageHandler::PACKAGE_DATA_SEPARATOR ); } diff --git a/application/hub/classes/registry/socket/class_SocketRegistry.php b/application/hub/classes/registry/socket/class_SocketRegistry.php index c3eb55e95..6e944b170 100644 --- a/application/hub/classes/registry/socket/class_SocketRegistry.php +++ b/application/hub/classes/registry/socket/class_SocketRegistry.php @@ -311,7 +311,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: key=' . $key . ',subKey=' . $subKey . ',socketInstance=' . $socketInstance->__toString()); // Is this a StorableSocket instance and is the address the same? - if (($socketInstance instanceof StorableSocket) && ($socketInstance->ifAddressMatches($packageInstance->getRecipientType()))) { + if (($socketInstance instanceof StorableSocket) && ($socketInstance->ifAddressMatches($packageInstance->getRecipientUnl()))) { // Debug die //* DEBUG-DIE: */ die(__METHOD__ . ': socketInstance=' . print_r($socketInstance, TRUE)); diff --git a/application/hub/classes/tags/package/class_PackageTags.php b/application/hub/classes/tags/package/class_PackageTags.php index 0e08f5b0f..7079839cc 100644 --- a/application/hub/classes/tags/package/class_PackageTags.php +++ b/application/hub/classes/tags/package/class_PackageTags.php @@ -8,6 +8,7 @@ use Org\Shipsimu\Hub\Factory\Registry\Object\ObjectTypeRegistryFactory; use Org\Shipsimu\Hub\Handler\Package\NetworkPackageHandler; use Org\Shipsimu\Hub\Listener\Listenable; use Org\Shipsimu\Hub\Network\Package\DeliverablePackage; +use Org\Shipsimu\Hub\Node\Tagging\InvalidTagException; use Org\Shipsimu\Hub\Tag\BaseTag; use Org\Shipsimu\Hub\Tag\Tagable; use Org\Shipsimu\Hub\Template\Engine\Xml\ObjectRegistry\XmlObjectRegistryTemplateEngine; diff --git a/application/hub/exceptions/package/class_UnexpectedPackageStatusException.php b/application/hub/exceptions/package/class_UnexpectedPackageStatusException.php index 1d7db4f54..f6f6b7971 100644 --- a/application/hub/exceptions/package/class_UnexpectedPackageStatusException.php +++ b/application/hub/exceptions/package/class_UnexpectedPackageStatusException.php @@ -37,12 +37,12 @@ class UnexpectedPackageStatusException extends FrameworkException { */ public function __construct (array $messageArray, $code) { // Construct the message - $message = sprintf('[%s:%d] Unexpected package status %s!=%s detected, recipientType=%s, sender=%s:%d, hash=%s.', + $message = sprintf('[%s:%d] Unexpected package status %s!=%s detected, recipientUnl=%s, sender=%s:%d, hash=%s.', $messageArray[0]->__toString(), $this->getLine(), $messageArray[1]->getPackageStatus(), $messageArray[2], - $messageArray[1]->getRecipientType(), + $messageArray[1]->getRecipientUnl(), $messageArray[1]->getSenderAddress(), $messageArray[1]->getSenderPort(), $messageArray[1]->getHash() diff --git a/application/hub/exceptions/unl/class_InvalidUnlException.php b/application/hub/exceptions/unl/class_InvalidUnlException.php index b1a6c071a..ecf8aac05 100644 --- a/application/hub/exceptions/unl/class_InvalidUnlException.php +++ b/application/hub/exceptions/unl/class_InvalidUnlException.php @@ -40,11 +40,11 @@ class InvalidUnlException extends FrameworkException { */ public function __construct (array $messageArray, $code) { // Construct the message - $message = sprintf('[%s:%d] The protocol handler %s cannot validate recipient %s.', + $message = sprintf('[%s:%d] The protocol handler %s cannot validate recipientUnl=%s.', $messageArray[0]->__toString(), $this->getLine(), $messageArray[1]->__toString(), - $messageArray[2]->getRecipientType() + $messageArray[2]->getRecipientUnl() ); // Call parent exception constructor -- 2.39.5