httpx/test/support/session_with_single_stream.rb
HoneyryderChuck 035eda1f95 fixed another loop caused by certain connection goaway frames from
server not being processed

While introducing yet another test to catch frame processing errors, in
this case with the SETTINGS_TIMEOUT error, another loop was found. It
was caused by two reasons:

* connection was signaling it was "closing" on such an error, which is
  not really true (server already closed the stream, so no need to
  close it again); it should be marked as closed instead.
* write buffer was still full (with the handshake in this case), so the
  connection was still trying to write;
2020-11-27 13:47:36 +00:00

20 lines
457 B
Ruby

# frozen_string_literal: true
#
# This module is used only to test transitions from a full HTTP/2 connection when it
# exhausts the number of streamss
#
module SessionWithSingleStream
module ConnectionMethods
def build_parser
parser = super
def parser.exhausted?
@connection.active_stream_count.positive?
end
parser.instance_variable_set(:@max_requests, 10)
parser.max_streams = 1
parser
end
end
end