protected function processInputBuffer()
    {
        //$this->logger->debug('Trying to process buffer of HttpClient');

        if ($this->request === null) { //New request
            if (isset($this->inputBuffer[HttpRequest::MAX_HEADER_LENGTH])) { //Much faster than strlen ;)
                $this->logger->warning("Client $this sent headers larger than " . HttpRequest::MAX_HEADER_LENGTH . ' bytes');
                $this->inputBuffer = '';
                throw new HttpException('Server refused request exceeding ' . HttpRequest::MAX_HEADER_LENGTH . ' bytes',
                    HttpCode::REQUEST_HEADER_FIELDS_TOO_LARGE, array(), true);
            }

            $headersBreakpoint = strpos($this->inputBuffer, "\r\n\r\n"); //Try to find headers breakpoint
            if ($headersBreakpoint === false) { //Not found, nothing to do
                //$this->logger->debug('Buffer doesn't contain full HTTP headers [yet]');
                return;
            }

            //TODO: Refactor to 2x substr (based on $headersBreakpoint) - it's ~5% faster [but it need to be changed along with payloads support]
            list($headers, $this->inputBuffer) = explode("\r\n\r\n", $this->inputBuffer, 2);
            //$this->logger->debug('Got HTTP headers, creating HttpRequest...');
            $this->request = new HttpRequest($headers, $this->logger);
        }
        //In future: else { add data to already created request }
    }