Class: HTTPX::Plugins::H2C::H2CParser

Inherits:
Connection::HTTP2 show all
Defined in:
lib/httpx/plugins/h2c.rb

Constant Summary

Constants inherited from Connection::HTTP2

Connection::HTTP2::MAX_CONCURRENT_REQUESTS

Constants included from Loggable

Loggable::COLORS, Loggable::USE_DEBUG_LOG

Instance Attribute Summary

Attributes inherited from Connection::HTTP2

#pending, #streams

Instance Method Summary collapse

Methods inherited from Connection::HTTP2

#<<, #can_buffer_more_requests?, #close, #consume, #empty?, #exhausted?, #handle_error, #initialize, #interests, #ping, #send, #timeout

Methods included from Loggable

#log, #log_exception

Methods included from Callbacks

#callbacks_for?, #emit, #on, #once

Constructor Details

This class inherits a constructor from HTTPX::Connection::HTTP2

Instance Method Details

#upgrade(request, response) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/httpx/plugins/h2c.rb', line 29

def upgrade(request, response)
  # skip checks, it is assumed that this is the first
  # request in the connection
  stream = @connection.upgrade

  # on_settings
  handle_stream(stream, request)
  @streams[request] = stream

  # clean up data left behind in the buffer, if the server started
  # sending frames
  data = response.read
  @connection << data
end