public function input($buffer, $connection) {        
        $len = strlen($buffer);
        
        $method = substr($buffer, 0, strpos($buffer, ' '));
        if($len >= 8 && !in_array($method, $this->methods)) {
            throw new \Exception('Bad Request Method', 400);
        }
        
        
        if (!strpos($buffer, "\r\n\r\n")) {
            if ($len >= $this->max_header_size) {
                throw new \Exception('Too Large Request Header', 412);
            }
            return 0;
        }
        
        list($header,$body) = explode("\r\n\r\n", $buffer, 2);
        
        if (strlen($header) >= $this->max_header_size) {
            throw new \Exception('Too Large Request Header', 413);
        }
        
        return $this->getRequestSize($header, $body, $method, $connection);
    }