]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/handler/chunks/class_ChunkHandler.php
Continued with development:
[hub.git] / application / hub / main / handler / chunks / class_ChunkHandler.php
index 14a726563dd477563c8596d6816cc2c27c7b63f4..8ee59a934321be9850e46fbf1d282dfc207e5337 100644 (file)
@@ -94,7 +94,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
         *
         * @return      $unhandledChunks        Whether unhandled chunks are left
         */
-       public function ifUnhandledChunksAvailable () {
+       public function ifUnhandledChunksWithFinalAvailable () {
                // Simply check if the stacker is not empty
                $unhandledChunks = $this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP) === false;
 
@@ -109,9 +109,9 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
         *
         * @return      void
         */
-       public function handleAvailableChunks () {
+       public function handleAvailableChunksWithFinal () {
                // First check if there are undhandled chunks available
-               assert($this->ifUnhandledChunksAvailable());
+               assert($this->ifUnhandledChunksWithFinalAvailable());
 
                // Get an entry from the stacker
                $chunk = $this->getStackerInstance()->popNamed(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP);
@@ -141,6 +141,12 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
                        // Don't process this chunk
                        return;
                } // END - if
+
+               /*
+                * It is now known that (as long as the hash algorithm has no
+                * collisions) the content is the same as the sender sends it to this
+                * peer.
+                */
                die('chunk=' . $chunk . chr(10));
        }
 }