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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b97c3d3611a531fe2facdfe1d21540e45c9857cb83d1d4f5eca735c12efbabe
4
- data.tar.gz: 07bfed2bc270bea6fcc2e62caf5cf46cb2e511acbcb563603651223de3d41869
3
+ metadata.gz: 85110feabc1cc1bb5247a1a7f6c6688b2e3bf9c647e7b6220c6371f1d9ffa2c6
4
+ data.tar.gz: 8376acd100932d35bc4a3c0a58b74b62cbb395e6d2bf87ca07e48baf9c0bd017
5
5
  SHA512:
6
- metadata.gz: f9a90343af8732527276180fcb417b1493476bd20459b1c849cba6d9935fae8f8eb07bef20ee9750b3da8f8763586ac719815793c07ad4cc6079f73b0b1b91eb
7
- data.tar.gz: f5d27cb750a6e14c02fdeede7308bf0ed180c1fe92b2e6cf982525267591b70632123f22459d014f394efc987cef3af0e47be629f4ac3550f1518c377c9f8dbe
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
- write_frame(frame)
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
- write_frame(frame)
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
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Protocol
22
22
  module HTTP2
23
- VERSION = "0.7.4"
23
+ VERSION = "0.8.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams