From: Roland Häder Date: Fri, 22 Feb 2013 03:49:02 +0000 (+0000) Subject: Also check for node id to have full match, this requires you to remove all *.serializ... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fab88735d3d4f2b3a979c6a6a5dd3cd8eb5f733c;p=hub.git Also check for node id to have full match, this requires you to remove all *.serialized in db/node_data and db/node_dht/ --- diff --git a/application/hub/main/database/wrapper/node/class_NodeDistributedHashTableDatabaseWrapper.php b/application/hub/main/database/wrapper/node/class_NodeDistributedHashTableDatabaseWrapper.php index 45208a22e..dc494d5bc 100644 --- a/application/hub/main/database/wrapper/node/class_NodeDistributedHashTableDatabaseWrapper.php +++ b/application/hub/main/database/wrapper/node/class_NodeDistributedHashTableDatabaseWrapper.php @@ -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 diff --git a/application/hub/main/package/fragmenter/class_PackageFragmenter.php b/application/hub/main/package/fragmenter/class_PackageFragmenter.php index 2debe34fa..3a9adc3ed 100644 --- a/application/hub/main/package/fragmenter/class_PackageFragmenter.php +++ b/application/hub/main/package/fragmenter/class_PackageFragmenter.php @@ -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;