File tree 2 files changed +12
-11
lines changed
lib/async/http/protocol/http2
2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -137,8 +137,8 @@ module HTTP
137
137
if trailer = request . headers [ 'trailer' ]
138
138
expect ( request . headers ) . not . to have_keys ( 'etag' )
139
139
140
- request_received . value = true ; pp request . body
141
- pp finish : request . finish
140
+ request_received . value = true
141
+ request . finish
142
142
143
143
expect ( request . headers ) . to have_keys ( 'etag' )
144
144
Original file line number Diff line number Diff line change @@ -51,17 +51,16 @@ def write(chunk)
51
51
end
52
52
53
53
def close_write ( error = nil )
54
- close ( error )
54
+ if stream = @stream
55
+ @stream = nil
56
+ stream . finish_output ( error )
57
+ end
55
58
end
56
59
57
60
# This method should only be called from within the context of the output task.
58
61
def close ( error = nil )
62
+ close_write ( error )
59
63
stop ( error )
60
-
61
- if stream = @stream
62
- @stream = nil
63
- stream . finish_output ( error )
64
- end
65
64
end
66
65
67
66
# This method should only be called from within the context of the HTTP/2 stream.
@@ -99,12 +98,14 @@ def passthrough(task)
99
98
rescue => error
100
99
raise
101
100
ensure
102
- if @ body
103
- @body . close ( error )
101
+ # Ensure the body we are reading from is fully closed:
102
+ if body = @body
104
103
@body = nil
104
+ body . close ( error )
105
105
end
106
106
107
- self . close ( error )
107
+ # Ensure the output of this body is closed:
108
+ self . close_write ( error )
108
109
end
109
110
110
111
# Send `maximum_size` bytes of data using the specified `stream`. If the buffer has no more chunks, `END_STREAM` will be sent on the final chunk.
You can’t perform that action at this time.
0 commit comments