diff --git a/lib/async/http/protocol/http1/finishable.rb b/lib/async/http/protocol/http1/finishable.rb index 26aee3f..a541065 100644 --- a/lib/async/http/protocol/http1/finishable.rb +++ b/lib/async/http/protocol/http1/finishable.rb @@ -15,6 +15,8 @@ class Finishable < ::Protocol::HTTP::Body::Wrapper def initialize(body) super(body) + $stderr.puts "Finishable#initialize: #{body.inspect}" + @closed = Async::Variable.new @error = nil @@ -28,12 +30,16 @@ def reading? def read @reading = true - super + super.tap do |chunk| + $stderr.puts "Finishable#read: #{chunk.inspect}" + end end def close(error = nil) super + $stderr.puts "Finishable#close: #{error.inspect}" + unless @closed.resolved? @error = error @closed.value = true