]> git.mxchange.org Git - hub.git/commitdiff
Rewrote some debug lines.
authorRoland Haeder <roland@mxchange.org>
Sun, 16 Feb 2014 00:05:04 +0000 (01:05 +0100)
committerRoland Haeder <roland@mxchange.org>
Sun, 16 Feb 2014 00:05:04 +0000 (01:05 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
application/hub/main/handler/chunks/class_ChunkHandler.php

index 746bd855bef35054cb171478acd5f7e4f4d8617e..2486969c7ff2992c02cd92fe8f131bf1b64edebd 100644 (file)
@@ -151,15 +151,22 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
         * @return      $isValid                Whether the hash is "valid"
         */
        private function isChunkHashValid (array $chunkSplits) {
+               // Noisy debug line:
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: chunkSplits=' . print_r($chunkSplits, TRUE));
+
+               // Assert on some elements
+               assert(isset($chunkSplits[self::CHUNK_SPLITS_INDEX_RAW_DATA]));
+               assert(isset($chunkSplits[self::CHUNK_SPLITS_INDEX_HASH]));
+
                // Now hash the raw data again
                $chunkHash = $this->getCryptoInstance()->hashString($chunkSplits[self::CHUNK_SPLITS_INDEX_RAW_DATA], $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH], FALSE);
 
-               // Debug output
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: chunkHash=' . $chunkHash . ',chunkSplits[chunk_hash]=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH] . ',chunkSplits[serial]=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_SERIAL] . ',chunkSplits[raw_data]=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_RAW_DATA]);
-
                // Check it
                $isValid = ($chunkSplits[self::CHUNK_SPLITS_INDEX_HASH] === $chunkHash);
 
+               // Debug output
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: chunkHash=' . $chunkHash . ',isValid=' . intval($isValid));
+
                // ... and return it
                return $isValid;
        }