]> git.mxchange.org Git - hub.git/commitdiff
Do not call handlePackageByUnhandledPackage() directly, this caused decoding of alrea...
authorRoland Häder <roland@mxchange.org>
Tue, 7 Aug 2012 16:11:18 +0000 (16:11 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 7 Aug 2012 16:11:18 +0000 (16:11 +0000)
application/hub/main/package/assembler/class_PackageAssembler.php

index f69ca26f9422732fe250dd7d82d9040c909d6f53..641204f239c72ef3afdb4b89e52b8173b7182a5e 100644 (file)
@@ -152,20 +152,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER: Partial data received. Waiting for more ... ( ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes)');
                } else {
                        // Debug message
-                       //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('packageContent=' . print_r($packageContent,true) . ',chunks='.print_r($chunks,true));
-
-                       /*
-                        * "explode" the string from 'raw_data' with chunk separator to
-                        * get an array of chunks. These chunks must then be verified by
-                        * their checksums. Also the final chunk must be handled.
-                        */
-                       $chunks = explode(PackageFragmenter::CHUNK_SEPARATOR, $packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]);
-
-                       // Now get a chunk handler instance
-                       $handlerInstance = ChunkHandlerFactory::createChunkHandlerInstance();
-
-                       // Add all chunks because the last final chunk is found
-                       $handlerInstance->addAllChunksWithFinal($chunks);
+                       /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('packageContent=' . print_r($packageContent,true) . ',chunks='.print_r($chunks,true));
                }
        }
 
@@ -207,8 +194,18 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable
                // Debug message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER: Last block of partial data received. A total of ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes has been received.');
 
-               // Call the real handler method
-               $this->handlePackageByUnhandledPackage($packageContent);
+               /*
+                * "explode" the string from 'raw_data' with chunk separator to
+                * get an array of chunks. These chunks must then be verified by
+                * their checksums. Also the final chunk must be handled.
+                */
+               $chunks = explode(PackageFragmenter::CHUNK_SEPARATOR, $packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]);
+
+               // Now get a chunk handler instance
+               $handlerInstance = ChunkHandlerFactory::createChunkHandlerInstance();
+
+               // Add all chunks because the last final chunk is found
+               $handlerInstance->addAllChunksWithFinal($chunks);
        }
 }