From: Roland Haeder Date: Sun, 16 Feb 2014 00:19:53 +0000 (+0100) Subject: Also commented these out as the bug is not located here. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=27ffe0a0c27ced2fab3644ef1b36408832179b54;p=hub.git Also commented these out as the bug is not located here. Signed-off-by: Roland Haeder --- diff --git a/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php b/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php index 28abab080..ea089fdf3 100644 --- a/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php +++ b/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php @@ -84,8 +84,8 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable { $this->lastSocketError = socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE]); // Debug output of read data length - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: rawData[' . gettype($rawData) . ']=' . strlen($rawData) . ',MD5=' . md5($rawData) . ',resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',error=' . socket_strerror($this->lastSocketError)); - /* NOISY-DEBUG: */ if ($rawData !== FALSE) self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: rawData=' . $rawData); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: rawData[' . gettype($rawData) . ']=' . strlen($rawData) . ',MD5=' . md5($rawData) . ',resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',error=' . socket_strerror($this->lastSocketError)); + //* NOISY-DEBUG: */ if ($rawData !== FALSE) self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: rawData=' . $rawData); // Is it valid? if ($this->lastSocketError == 11) { @@ -114,7 +114,7 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable { * well-formed BASE64-encoded message with start and markers. This * will be checked later on. */ - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . strlen($rawData) . ' bytes to stacker ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . strlen($rawData) . ' bytes to stacker ...'); $this->addRawDataToStacker($rawData); } } diff --git a/application/hub/main/helper/connection/class_BaseConnectionHelper.php b/application/hub/main/helper/connection/class_BaseConnectionHelper.php index 450f3f3af..7fa40d17f 100644 --- a/application/hub/main/helper/connection/class_BaseConnectionHelper.php +++ b/application/hub/main/helper/connection/class_BaseConnectionHelper.php @@ -401,7 +401,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, // Convert the package data array to a raw data stream $dataStream = $this->getRawDataFromPackageArray($packageData); - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . strlen($dataStream) . ' bytes to the sending buffer ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . strlen($dataStream) . ' bytes to the sending buffer ...'); $rawData .= $dataStream; } // END - while @@ -412,7 +412,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, $encodedData = $this->getOutputStreamInstance()->streamData($rawData); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: rawData()=' . strlen($rawData) . ',encodedData()=' . strlen($encodedData)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: rawData()=' . strlen($rawData) . ',encodedData()=' . strlen($encodedData)); // Calculate difference $this->diff = $bufferSize - strlen($encodedData); @@ -426,15 +426,15 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, // Deliver all data while ($sentBytes !== FALSE) { // And deliver it - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Sending out ' . strlen($encodedData) . ' bytes,bufferSize=' . $bufferSize . ',diff=' . $this->diff); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Sending out ' . strlen($encodedData) . ' bytes,bufferSize=' . $bufferSize . ',diff=' . $this->diff); if ($this->diff >= 0) { // Send all out (encodedData is smaller than or equal buffer size) - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: MD5=' . md5(substr($encodedData, 0, ($bufferSize - $this->diff)))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: MD5=' . md5(substr($encodedData, 0, ($bufferSize - $this->diff)))); $sentBytes = socket_write($socketResource, $encodedData, ($bufferSize - $this->diff)); } else { // Send buffer size out - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: MD5=' . md5(substr($encodedData, 0, $bufferSize))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: MD5=' . md5(substr($encodedData, 0, $bufferSize))); $sentBytes = socket_write($socketResource, $encodedData, $bufferSize); } @@ -447,7 +447,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, throw new InvalidSocketException(array($this, $socketResource, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); } elseif (($sentBytes == 0) && (strlen($encodedData) > 0)) { // Nothing sent means we are done - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); break; } @@ -458,7 +458,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, $totalSentBytes += $sentBytes; // Cut out the last unsent bytes - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Sent out ' . $sentBytes . ' of ' . strlen($encodedData) . ' bytes ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Sent out ' . $sentBytes . ' of ' . strlen($encodedData) . ' bytes ...'); $encodedData = substr($encodedData, $sentBytes); // Calculate difference again @@ -467,13 +467,13 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, // Can we abort? if (strlen($encodedData) <= 0) { // Abort here, all sent! - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); break; } // END - if } // END - while // Return sent bytes - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: totalSentBytes=' . $totalSentBytes . ',diff=' . $this->diff); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: totalSentBytes=' . $totalSentBytes . ',diff=' . $this->diff); return $totalSentBytes; } diff --git a/application/hub/main/listener/tcp/class_TcpListener.php b/application/hub/main/listener/tcp/class_TcpListener.php index d542d09a9..da332df8f 100644 --- a/application/hub/main/listener/tcp/class_TcpListener.php +++ b/application/hub/main/listener/tcp/class_TcpListener.php @@ -238,7 +238,7 @@ class TcpListener extends BaseListener implements Listenable { $newSocket = socket_accept($this->getSocketResource()); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: newSocket=' . $newSocket . ',serverSocket=' .$this->getSocketResource()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: newSocket=' . $newSocket . ',serverSocket=' .$this->getSocketResource()); // Array for timeout settings $options = array(