Skip to content

Commit 4f0256b

Browse files
authored
Remove support for HTTP/2 priority. (#192)
1 parent f81e238 commit 4f0256b

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

async-http.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
3030
spec.add_dependency "io-stream", "~> 0.6"
3131
spec.add_dependency "protocol-http", "~> 0.43"
3232
spec.add_dependency "protocol-http1", ">= 0.28.1"
33-
spec.add_dependency "protocol-http2", "~> 0.19"
33+
spec.add_dependency "protocol-http2", "~> 0.21"
3434
spec.add_dependency "traces", "~> 0.10"
3535
spec.add_dependency "metrics", "~> 0.12"
3636
end

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

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def window_updated(size)
3737
@guard.synchronize do
3838
@window_updated.signal
3939
end
40+
41+
return true
4042
end
4143

4244
def write(chunk)

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def hijack?
112112

113113
def send_response(response)
114114
if response.nil?
115-
return @stream.send_headers(nil, NO_RESPONSE, ::Protocol::HTTP2::END_STREAM)
115+
return @stream.send_headers(NO_RESPONSE, ::Protocol::HTTP2::END_STREAM)
116116
end
117117

118118
protocol_headers = [
@@ -129,14 +129,14 @@ def send_response(response)
129129
# This function informs the headers object that any subsequent headers are going to be trailer. Therefore, it must be called *before* sending the headers, to avoid any race conditions.
130130
trailer = response.headers.trailer!
131131

132-
@stream.send_headers(nil, headers)
132+
@stream.send_headers(headers)
133133

134134
@stream.send_body(body, trailer)
135135
else
136136
# Ensure the response body is closed if we are ending the stream:
137137
response.close
138138

139-
@stream.send_headers(nil, headers, ::Protocol::HTTP2::END_STREAM)
139+
@stream.send_headers(headers, ::Protocol::HTTP2::END_STREAM)
140140
end
141141
end
142142

@@ -149,7 +149,7 @@ def write_interim_response(status, headers = nil)
149149
interim_response_headers = ::Protocol::HTTP::Headers::Merged.new(interim_response_headers, headers)
150150
end
151151

152-
@stream.send_headers(nil, interim_response_headers)
152+
@stream.send_headers(interim_response_headers)
153153
end
154154
end
155155
end

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def send_request(request)
222222
)
223223

224224
if request.body.nil?
225-
@stream.send_headers(nil, headers, ::Protocol::HTTP2::END_STREAM)
225+
@stream.send_headers(headers, ::Protocol::HTTP2::END_STREAM)
226226
else
227227
if length = request.body.length
228228
# This puts it at the end of the pseudo-headers:
@@ -233,7 +233,7 @@ def send_request(request)
233233
trailer = request.headers.trailer!
234234

235235
begin
236-
@stream.send_headers(nil, headers)
236+
@stream.send_headers(headers)
237237
rescue
238238
raise RequestFailed
239239
end

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def finish_output(error = nil)
131131
else
132132
# Write trailer?
133133
if trailer&.any?
134-
send_headers(nil, trailer, ::Protocol::HTTP2::END_STREAM)
134+
send_headers(trailer, ::Protocol::HTTP2::END_STREAM)
135135
else
136136
send_data(nil, ::Protocol::HTTP2::END_STREAM)
137137
end
@@ -142,6 +142,8 @@ def window_updated(size)
142142
super
143143

144144
@output&.window_updated(size)
145+
146+
return true
145147
end
146148

147149
# When the stream transitions to the closed state, this method is called. There are roughly two ways this can happen:

0 commit comments

Comments
 (0)