From: Roland Haeder Date: Fri, 14 Mar 2014 20:51:39 +0000 (+0100) Subject: Noisy debug line added + check if start and end markers are set. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1981eabbdff4ef8409ee73a601c226dcaf6be5b5;p=hub.git Noisy debug line added + check if start and end markers are set. Signed-off-by: Roland Haeder --- diff --git a/application/hub/main/package/assembler/class_PackageAssembler.php b/application/hub/main/package/assembler/class_PackageAssembler.php index c39df7864..0eec7aff0 100644 --- a/application/hub/main/package/assembler/class_PackageAssembler.php +++ b/application/hub/main/package/assembler/class_PackageAssembler.php @@ -192,6 +192,13 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable // Assert on condition assert(!$this->isPendingDataEmpty()); + // No markers set? + if (!$this->ifStartEndMarkersSet($this->pendingData)) { + // This will cause an assertition in next call, so simply wait for more data + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ': Pending data of ' . strlen($this->pendingData) . ' Bytes are incomplete, waiting for more ...'); + return; + } // END - if + // Init fake array $packageContent = array( BaseRawDataHandler::PACKAGE_RAW_DATA => $this->getInputStreamInstance()->streamData($this->pendingData), diff --git a/application/hub/main/streams/raw_data/input/class_RawDataInputStream.php b/application/hub/main/streams/raw_data/input/class_RawDataInputStream.php index 37a87b2c2..dfce170c4 100644 --- a/application/hub/main/streams/raw_data/input/class_RawDataInputStream.php +++ b/application/hub/main/streams/raw_data/input/class_RawDataInputStream.php @@ -60,6 +60,9 @@ class RawDataInputStream extends BaseStream implements InputStreamable { * @throws Base64EncodingBadException If the data contains characters which are not in the "alphabet" of BASE64 messages. */ public function streamData ($data) { + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RAW-INPUT-STREAM[' . __METHOD__ . ':' . __LINE__ . ': data(' . strlen($data) . ')=' . $data); + // Do we have start and end marker again? assert($this->ifStartEndMarkersSet($data));