Skip to content

Commit 710d883

Browse files
committed
Don't set @input to nil until the stream is closed.
`wait_for_input` may race on a end frame.
1 parent 0c00924 commit 710d883

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/async/http/protocol/http2/stream.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ def process_headers(frame)
6161
self.receive_initial_headers(super, frame.end_stream?)
6262
end
6363

64-
# TODO this might need to be in an ensure block:
65-
if input = @input and frame.end_stream?
66-
@input = nil
67-
input.close_write
64+
if @input and frame.end_stream?
65+
@input.close_write
6866
end
6967
rescue ::Protocol::HTTP2::HeaderError => error
7068
Console.logger.debug(self, error)
@@ -103,7 +101,6 @@ def process_data(frame)
103101

104102
if frame.end_stream?
105103
@input.close_write
106-
@input = nil
107104
end
108105
end
109106

0 commit comments

Comments
 (0)