From 872eb20000550cb3e9c28e530d39d07040ceeb97 Mon Sep 17 00:00:00 2001 From: Pierre Tomasina Date: Fri, 12 Aug 2016 12:51:38 +0200 Subject: [PATCH] set class property for header length --- Server.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Server.php b/Server.php index d7c3fdb..c28f72d 100644 --- a/Server.php +++ b/Server.php @@ -56,6 +56,12 @@ class Server extends Connection */ protected $_request = null; + /** + * length of buffer used to extract header information + * + * @var int + */ + protected $headerLength = 2048; /** @@ -80,6 +86,17 @@ public function __construct( return; } + /** + * Set length of buffer used to extract header information + * + * @param int $length + * @return void + */ + public function setHeaderBufferSize($length) + { + $this->headerLength = (int)$length; + } + /** * Try the handshake by trying different protocol implementation. * @@ -89,7 +106,7 @@ public function __construct( protected function doHandshake() { $connection = $this->getConnection(); - $buffer = $connection->read(2048); + $buffer = $connection->read($this->headerLength); $request = $this->getRequest(); $request->parse($buffer);