]> git.mxchange.org Git - hub.git/commitdiff
Handle AssertionException and copy the raw data (do not decode partial data)
authorRoland Häder <roland@mxchange.org>
Sat, 4 Aug 2012 23:13:14 +0000 (23:13 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 4 Aug 2012 23:13:14 +0000 (23:13 +0000)
application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php

index 5ffe49ca2b15bd3e11b16900e760cae274b8cf57..12e9a351d7d9d5cd5427fb783f6d8559ffd9e8c2 100644 (file)
@@ -107,7 +107,16 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable {
                         * Low-level checks of the raw data went all fine, now decode the
                         * raw data. This may still fail because of invalid encoded data.
                         */
-                       $decodedData = $this->getInputStreamInstance()->streamData($rawData);
+                       try {
+                               $decodedData = $this->getInputStreamInstance()->streamData($rawData);
+                       } catch (AssertionException $e) {
+                               /*
+                                * This may happen with a multi-chunk stream (more data sent
+                                * than output/input buffers can handle) so the raw data needs
+                                * to be handled somewhere else.
+                                */
+                               $decodedData = $rawData;
+                       }
                }
 
                // Add the (maybe above decoded) data to the stacker