lib/async/http/protocol/http2/client.rb in async-http-0.43.1 vs lib/async/http/protocol/http2/client.rb in async-http-0.44.0
- old
+ new
@@ -40,20 +40,25 @@
def stop_connection(error)
super
@streams.each do |id, stream|
- stream.stop_connection(error)
+ if stream.respond_to?(:stop_connection)
+ stream.stop_connection(error)
+ end
end
end
# Used by the client to send requests to the remote server.
def call(request)
raise ::Protocol::HTTP2::Error, "Connection closed!" if self.closed?
@count += 1
- response = Response.new(self, next_stream_id)
+ stream_id = next_stream_id
+ response = Response.new(self, stream_id)
+ @streams[stream_id] = response.stream
+
response.send_request(request)
response.wait
return response
end