diff --git a/Classes/Client/AbstractClient.php b/Classes/Client/AbstractClient.php index 8bf3d86..f5bcfa9 100644 --- a/Classes/Client/AbstractClient.php +++ b/Classes/Client/AbstractClient.php @@ -42,14 +42,18 @@ abstract class Client_AbstractClient { } /** - * Forwards incoming data to the ProtocolParser. - * Calls protected processData() + * Forwards incoming data to the ProtocolHandler + * Let's the ProtocolHandler do all the work and forward its results to the Clients. + * Return resulting raw data. * @param string $rawData * @return string */ public function processRawData($rawData) { - $contentObject = $this->protocolHandler->pushRawData($rawData); - return $this->processContentObject($this->protocolHandler->); + $this->protocolHandler->pushRawData($rawData); + while($this->protocolHandler->canWork()) { + $this->processContentObject($this->protocolHandler->work()); + } + return $this->protocolHandler->getRawData(); } /** diff --git a/Classes/Protocol/AbstractProtocolHandler.php b/Classes/Protocol/AbstractProtocolHandler.php index a0aa29b..2f7d0d3 100644 --- a/Classes/Protocol/AbstractProtocolHandler.php +++ b/Classes/Protocol/AbstractProtocolHandler.php @@ -1,6 +1,8 @@ buffer_incoming->addData($rawData); + } + + /** + * Returns all outgoing data of the internal buffer. + * @return string + */ + public function getRawData() { + return $this->buffer_outgoing->getAllBufferContents(); + } } ?> \ No newline at end of file