protocol-hpack 1.2.2 → 1.3.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/hpack/decompressor.rb +5 -2
- data/lib/protocol/hpack/error.rb +3 -0
- data/lib/protocol/hpack/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: dbb8247fa7eb3b3ae4c8aadda670c34cf6c4b82d4ef9c0c2b9dab708cfcb94f9
|
4
|
+
data.tar.gz: fafe89f7170284e2c406dcf85a6308bc5bb98ff36d0e38284882c5e53d088370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acf91072388222f898e2ed09af677679037b8da6e9730010a43730260134289b580b8be00e8da7c626497ccb7feef11aef7bddf637e6b81577b4b40d3af380fc
|
7
|
+
data.tar.gz: aa88d7ef93b60650142fa24ad8358f8261e1d0c53822498deee7142e21c7dec0c2af5ef60fb6acf274aff756fa95e14e3f9d3e47267d93c9d2867c14eb4b149e
|
@@ -72,7 +72,7 @@ module Protocol
|
|
72
72
|
# @return [Integer]
|
73
73
|
def read_integer(bits)
|
74
74
|
limit = 2**bits - 1
|
75
|
-
value =
|
75
|
+
value = bits.zero? ? 0 : (read_byte & limit)
|
76
76
|
|
77
77
|
shift = 0
|
78
78
|
|
@@ -82,7 +82,7 @@ module Protocol
|
|
82
82
|
|
83
83
|
break if (byte & 128).zero?
|
84
84
|
end if (value == limit)
|
85
|
-
|
85
|
+
|
86
86
|
return value
|
87
87
|
end
|
88
88
|
|
@@ -94,6 +94,9 @@ module Protocol
|
|
94
94
|
huffman = (peek_byte & 0x80) == 0x80
|
95
95
|
|
96
96
|
length = read_integer(7)
|
97
|
+
|
98
|
+
raise CompressionError, "Invalid string length!" unless length
|
99
|
+
|
97
100
|
string = read_bytes(length)
|
98
101
|
|
99
102
|
raise CompressionError, "Invalid string length, got #{string.bytesize}, expecting #{length}!" unless string.bytesize == length
|
data/lib/protocol/hpack/error.rb
CHANGED