class HTTPX::Parser::HTTP1

  1. lib/httpx/parser/http1.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. <<
  2. headers
  3. http_version
  4. reset!
  5. status_code
  6. upgrade?
  7. upgrade_data

Constants

VERSIONS = %w[1.0 1.1].freeze  

Attributes

Public Class methods

new(observer)
[show source]
   # File lib/httpx/parser/http1.rb
12 def initialize(observer)
13   @observer = observer
14   @state = :idle
15   @buffer = "".b
16   @headers = {}
17 end

Public Instance methods

<<(chunk)
[show source]
   # File lib/httpx/parser/http1.rb
19 def <<(chunk)
20   @buffer << chunk
21   parse
22 end
reset!()
[show source]
   # File lib/httpx/parser/http1.rb
24 def reset!
25   @state = :idle
26   @headers.clear
27   @content_length = nil
28   @_has_trailers = nil
29 end
upgrade?()
[show source]
   # File lib/httpx/parser/http1.rb
31 def upgrade?
32   @upgrade
33 end
upgrade_data()
[show source]
   # File lib/httpx/parser/http1.rb
35 def upgrade_data
36   @buffer
37 end