Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

Commit 872eb20

Browse files
committed
set class property for header length
1 parent 3eca298 commit 872eb20

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

Server.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ class Server extends Connection
5656
*/
5757
protected $_request = null;
5858

59+
/**
60+
* length of buffer used to extract header information
61+
*
62+
* @var int
63+
*/
64+
protected $headerLength = 2048;
5965

6066

6167
/**
@@ -80,6 +86,17 @@ public function __construct(
8086
return;
8187
}
8288

89+
/**
90+
* Set length of buffer used to extract header information
91+
*
92+
* @param int $length
93+
* @return void
94+
*/
95+
public function setHeaderBufferSize($length)
96+
{
97+
$this->headerLength = (int)$length;
98+
}
99+
83100
/**
84101
* Try the handshake by trying different protocol implementation.
85102
*
@@ -89,7 +106,7 @@ public function __construct(
89106
protected function doHandshake()
90107
{
91108
$connection = $this->getConnection();
92-
$buffer = $connection->read(2048);
109+
$buffer = $connection->read($this->headerLength);
93110
$request = $this->getRequest();
94111
$request->parse($buffer);
95112

0 commit comments

Comments
 (0)