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

Commit

Permalink
set class property for header length
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierozi committed Aug 12, 2016
1 parent 3eca298 commit 872eb20
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ class Server extends Connection
*/
protected $_request = null;

/**
* length of buffer used to extract header information
*
* @var int
*/
protected $headerLength = 2048;


/**
Expand All @@ -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.
*
Expand All @@ -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);

Expand Down

0 comments on commit 872eb20

Please sign in to comment.