protocol-http2 0.7.4 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/protocol/http2/connection.rb +4 -1
- data/lib/protocol/http2/stream.rb +14 -8
- data/lib/protocol/http2/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85110feabc1cc1bb5247a1a7f6c6688b2e3bf9c647e7b6220c6371f1d9ffa2c6
|
4
|
+
data.tar.gz: 8376acd100932d35bc4a3c0a58b74b62cbb395e6d2bf87ca07e48baf9c0bd017
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ceade72df2cb2876365da7d3b9599d7d0ad15c83630865f8fa7b845f61383a490c7a8c4ee965af251cd265e27309009e2d8718d2e94919aee152870a1623174
|
7
|
+
data.tar.gz: '08f5d7dd7b8824ee59b20d168dc9d323f5972aa2adb0cf8f3ffc4e64794f741ee96523cf6195674310263711dc44e585ef868deb58dcbb0ef321c7d2888f9218'
|
@@ -225,10 +225,13 @@ module Protocol
|
|
225
225
|
end
|
226
226
|
|
227
227
|
def write_frame(frame)
|
228
|
-
# puts "#{self.class} #{@state} write_frame: class=#{frame.class} flags=#{frame.flags} length=#{frame.length}"
|
229
228
|
@framer.write_frame(frame)
|
230
229
|
end
|
231
230
|
|
231
|
+
def write_frames
|
232
|
+
yield @framer
|
233
|
+
end
|
234
|
+
|
232
235
|
def update_local_settings(changes)
|
233
236
|
capacity = @local_settings.initial_window_size
|
234
237
|
|
@@ -229,12 +229,15 @@ module Protocol
|
|
229
229
|
end
|
230
230
|
|
231
231
|
private def write_headers(priority, headers, flags = 0)
|
232
|
-
data = @connection.encode_headers(headers)
|
233
|
-
|
234
232
|
frame = HeadersFrame.new(@id, flags)
|
235
|
-
frame.pack(priority, data, maximum_size: @connection.maximum_frame_size)
|
236
233
|
|
237
|
-
|
234
|
+
@connection.write_frames do |framer|
|
235
|
+
data = @connection.encode_headers(headers)
|
236
|
+
|
237
|
+
frame.pack(priority, data, maximum_size: @connection.maximum_frame_size)
|
238
|
+
|
239
|
+
framer.write_frame(frame)
|
240
|
+
end
|
238
241
|
|
239
242
|
return frame
|
240
243
|
end
|
@@ -434,12 +437,15 @@ module Protocol
|
|
434
437
|
# A push promise is server request -> client -> server response -> client.
|
435
438
|
# The server generates the same set of headers as if the client was sending a request, and sends these to the client. The client can reject the request by resetting the (new) stream. Otherwise, the server will start sending a response as if the client had send the request.
|
436
439
|
private def write_push_promise(stream_id, headers, flags = 0, **options)
|
437
|
-
data = @connection.encode_headers(headers)
|
438
|
-
|
439
440
|
frame = PushPromiseFrame.new(@id, flags)
|
440
|
-
frame.pack(stream_id, data, maximum_size: @connection.maximum_frame_size)
|
441
441
|
|
442
|
-
|
442
|
+
@connection.write_frames do |framer|
|
443
|
+
data = @connection.encode_headers(headers)
|
444
|
+
|
445
|
+
frame.pack(stream_id, data, maximum_size: @connection.maximum_frame_size)
|
446
|
+
|
447
|
+
framer.write_frame(frame)
|
448
|
+
end
|
443
449
|
|
444
450
|
return frame
|
445
451
|
end
|