]> git.mxchange.org Git - hub.git/commitdiff
Also check for node id to have full match, this requires you to remove all *.serializ...
authorRoland Häder <roland@mxchange.org>
Fri, 22 Feb 2013 03:49:02 +0000 (03:49 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 22 Feb 2013 03:49:02 +0000 (03:49 +0000)
application/hub/main/database/wrapper/node/class_NodeDistributedHashTableDatabaseWrapper.php
application/hub/main/package/fragmenter/class_PackageFragmenter.php

index 45208a22e952bd3a9b7563b8d75b898be64a614e..dc494d5bc59fe78c3d84ffbe2417dbd50987f508 100644 (file)
@@ -117,9 +117,10 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem
                        // Make sure both is valid
                        assert(($ipPort[0] !== 'invalid') && ($ipPort[1] !== 'invalid'));
 
-                       // Add ip:port as criteria
+                       // Add ip:port/node id as criteria
                        $searchInstance->addCriteria(self::DB_COLUMN_EXTERNAL_IP, $ipPort[0]);
                        $searchInstance->addCriteria(self::DB_COLUMN_LISTEN_PORT, $ipPort[1]);
+                       $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID    , $nodeInstance->getNodeId());
                        $searchInstance->setLimit(1);
 
                        // Query database and get a result instance back
index 2debe34fadacb94abb637526c45e41f48c20096a..3a9adc3edee46c04181e77e40805c845fdbf5bd4 100644 (file)
@@ -366,7 +366,8 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
                );
 
                // Make sure the chunk is not larger than a TCP package can hold
-               assert(strlen($rawData) <= NetworkPackage::TCP_PACKAGE_SIZE);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': assert: ' . strlen($rawData) . '/' . NetworkPackage::TCP_PACKAGE_SIZE . ' ...');
+               // @TODO This assert broke packages where the hash chunk was very large: assert(strlen($rawData) <= NetworkPackage::TCP_PACKAGE_SIZE);
 
                // Add it to the array
                if ($prepend === true) {
@@ -519,7 +520,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
         */
        public function resetSerialNumber () {
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('FRAGMENTER: Resetting serial number, previous=' . $this->serialNumber);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('FRAGMENTER: Resetting serial number, previous=' . $this->serialNumber);
 
                // Reset serial number
                $this->serialNumber = 0;