From 3c59603bc3a1365de3ad1634a80b231b27b4a033 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 4 Aug 2012 23:13:14 +0000 Subject: [PATCH] Handle AssertionException and copy the raw data (do not decode partial data) --- .../handler/network/tcp/class_TcpRawDataHandler.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php b/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php index 5ffe49ca2..12e9a351d 100644 --- a/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php +++ b/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php @@ -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 -- 2.39.5