lib/async/http/protocol/http2/stream.rb in async-http-0.50.4 vs lib/async/http/protocol/http2/stream.rb in async-http-0.50.5

- old
+ new

@@ -127,10 +127,13 @@ def passthrough(task) task.annotate("Writing #{@body} to #{@stream}.") while chunk = @body&.read self.write(chunk) + # TODO this reduces memory usage? + # chunk.clear unless chunk.frozen? + # GC.start end self.close_write rescue Async::Stop # Ignore. @@ -199,10 +202,10 @@ headers.each do |key, value| add_trailer(key, value) end end - def receive_headers(frame) + def process_headers(frame) if @headers.nil? @headers = ::Protocol::HTTP::Headers.new self.receive_initial_headers(super, frame.end_stream?) @trailers = @headers[TRAILERS] elsif @trailers and frame.end_stream?