http-2 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/http/2/connection.rb +2 -1
- data/lib/http/2/extensions.rb +1 -1
- data/lib/http/2/framer.rb +2 -2
- data/lib/http/2/header/encoding_context.rb +16 -13
- data/lib/http/2/header/huffman.rb +1 -1
- data/lib/http/2/version.rb +1 -1
- data/sig/header/encoding_context.rbs +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 05c943cd91ee0339a8542cde981636d694618d64c80e30ff0f6ccb55fc636d45
|
|
4
|
+
data.tar.gz: 325abe52e215d7d7007f9fe383a3e8ebd8b1cdfae1a004fc227b5371efb637b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 88a97115e7d09b247b669c304fd3bced538c8be53263ca4f2650ddae125e7d7a3fa6b97419e2f8dbac9dcd3c95a0c581a494fc4b185664ae5d2d64bee9da3d7c
|
|
7
|
+
data.tar.gz: f8f257ed1e984d82c8209677d2496c21f000c9dc23ca6f754fe50b1309c4c2b92491fb4d6dfb608eb5f54923cf47fb1a2f508bbb97fa4ec2b1d62b5f51dbb145
|
data/lib/http/2/connection.rb
CHANGED
data/lib/http/2/extensions.rb
CHANGED
data/lib/http/2/framer.rb
CHANGED
|
@@ -185,7 +185,7 @@ module HTTP2
|
|
|
185
185
|
{
|
|
186
186
|
type: type,
|
|
187
187
|
flags: FRAME_FLAGS[type].filter_map do |name, pos|
|
|
188
|
-
name if flags.anybits?(
|
|
188
|
+
name if flags.anybits?(1 << pos)
|
|
189
189
|
end,
|
|
190
190
|
length: length,
|
|
191
191
|
stream: stream & RBIT
|
|
@@ -359,7 +359,7 @@ module HTTP2
|
|
|
359
359
|
# Padding: Padding octets that contain no application semantic value.
|
|
360
360
|
# Padding octets MUST be set to zero when sending and ignored when
|
|
361
361
|
# receiving.
|
|
362
|
-
append_str(bytes,
|
|
362
|
+
append_str(bytes, "\0" * padlen)
|
|
363
363
|
end
|
|
364
364
|
|
|
365
365
|
frame[:length] = length
|
|
@@ -211,7 +211,7 @@ module HTTP2
|
|
|
211
211
|
emit = [name, value]
|
|
212
212
|
|
|
213
213
|
# add to table
|
|
214
|
-
if type == :incremental && size_check(name.bytesize + value.bytesize + 32)
|
|
214
|
+
if type == :incremental && size_check?(name.bytesize + value.bytesize + 32)
|
|
215
215
|
@table.unshift(emit)
|
|
216
216
|
@current_table_size += name.bytesize + value.bytesize + 32
|
|
217
217
|
@_table_updated = true
|
|
@@ -302,7 +302,7 @@ module HTTP2
|
|
|
302
302
|
# When the size is reduced, some headers might be evicted.
|
|
303
303
|
def table_size=(size)
|
|
304
304
|
@limit = size
|
|
305
|
-
|
|
305
|
+
resize_table(0)
|
|
306
306
|
end
|
|
307
307
|
|
|
308
308
|
def listen_on_table
|
|
@@ -313,22 +313,25 @@ module HTTP2
|
|
|
313
313
|
|
|
314
314
|
private
|
|
315
315
|
|
|
316
|
+
def resize_table(cmdsize)
|
|
317
|
+
return if @table.empty?
|
|
318
|
+
|
|
319
|
+
while @current_table_size + cmdsize > @limit
|
|
320
|
+
|
|
321
|
+
name, value = @table.pop
|
|
322
|
+
@current_table_size -= name.bytesize + value.bytesize + 32
|
|
323
|
+
break if @table.empty?
|
|
324
|
+
|
|
325
|
+
end
|
|
326
|
+
end
|
|
327
|
+
|
|
316
328
|
# To keep the dynamic table size lower than or equal to @limit,
|
|
317
329
|
# remove one or more entries at the end of the dynamic table.
|
|
318
330
|
#
|
|
319
331
|
# @param cmdsize [Integer]
|
|
320
332
|
# @return [Boolean] whether +cmd+ fits in the dynamic table.
|
|
321
|
-
def size_check(cmdsize)
|
|
322
|
-
|
|
323
|
-
while @current_table_size + cmdsize > @limit
|
|
324
|
-
|
|
325
|
-
name, value = @table.pop
|
|
326
|
-
@current_table_size -= name.bytesize + value.bytesize + 32
|
|
327
|
-
break if @table.empty?
|
|
328
|
-
|
|
329
|
-
end
|
|
330
|
-
end
|
|
331
|
-
|
|
333
|
+
def size_check?(cmdsize)
|
|
334
|
+
resize_table(cmdsize)
|
|
332
335
|
cmdsize <= @limit
|
|
333
336
|
end
|
|
334
337
|
end
|
|
@@ -29,7 +29,7 @@ module HTTP2
|
|
|
29
29
|
def encode(str, buffer = "".b)
|
|
30
30
|
bitstring = String.new("", encoding: Encoding::BINARY, capacity: (str.bytesize * 30) + ((8 - str.size) % 8))
|
|
31
31
|
str.each_byte { |chr| append_str(bitstring, ENCODE_TABLE[chr]) }
|
|
32
|
-
append_str(bitstring,
|
|
32
|
+
append_str(bitstring, "1" * ((8 - bitstring.size) % 8))
|
|
33
33
|
pack([bitstring], "B*", buffer: buffer)
|
|
34
34
|
end
|
|
35
35
|
|
data/lib/http/2/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: http-2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tiago Cardoso
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
- Kaoru Maeda
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
13
|
dependencies: []
|
|
14
14
|
description: Pure-ruby HTTP 2.0 protocol implementation
|
|
15
15
|
email:
|
|
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
77
77
|
- !ruby/object:Gem::Version
|
|
78
78
|
version: '0'
|
|
79
79
|
requirements: []
|
|
80
|
-
rubygems_version: 3.6.
|
|
80
|
+
rubygems_version: 3.6.9
|
|
81
81
|
specification_version: 4
|
|
82
82
|
summary: Pure-ruby HTTP 2.0 protocol implementation
|
|
83
83
|
test_files: []
|