http-protocol 0.2.0 → 0.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a0181ccc138681d1fa437bf49e9760a45d841245baffd0da21e604a8eaab309
|
4
|
+
data.tar.gz: 64cd9dfba7a97c8b0f22a6e5492a4757d331349bc26fc53f5590442ed393576e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '02369ca5d469cbc24140bafbd5c1bbd6a0949364139c9c78794ee8e7aa36c55d36937c4f7ea5d60978eb31d9fb539c13f2121ea82aa1bdb45a377e80f73f5254'
|
7
|
+
data.tar.gz: 4d3f147a6491b19f5bdc667bf3f5508836c23e1494091775dd550696df2137272cb829cf1a727e28d16a66c942d7dfa76c704a1531f36f2affec0b038b7d56ae
|
@@ -45,7 +45,7 @@ module HTTP
|
|
45
45
|
elsif amount >= 0 and amount <= @remote_window.available
|
46
46
|
@remote_window.consume(amount)
|
47
47
|
else
|
48
|
-
raise FlowControlError, "Trying to send #{frame.
|
48
|
+
raise FlowControlError, "Trying to send #{frame.length} bytes, exceeded window size: #{@remote_window.available} (#{@remote_window})"
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -40,28 +40,18 @@ module HTTP
|
|
40
40
|
flag_set?(PADDED)
|
41
41
|
end
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
def pack(data, modulus: MODULUS, padding_size: nil, maximum_size: nil)
|
47
|
-
padding_size ||= (MODULUS - data.bytesize) % MODULUS
|
48
|
-
|
49
|
-
if maximum_size
|
50
|
-
maximum_padding_size = maximum_size - data.bytesize
|
51
|
-
|
52
|
-
if padding_size > maximum_padding_size
|
53
|
-
padding_size = maximum_padding_size
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
if padding_size > 0
|
43
|
+
def pack(data, padding_size: nil, maximum_size: nil)
|
44
|
+
if padding_size
|
58
45
|
set_flags(PADDED)
|
59
46
|
|
60
47
|
buffer = String.new.b
|
61
48
|
|
62
49
|
buffer << padding_size.chr
|
63
50
|
buffer << data
|
64
|
-
|
51
|
+
|
52
|
+
if padding_size > 1
|
53
|
+
buffer << "\0" * (padding_size - 1)
|
54
|
+
end
|
65
55
|
|
66
56
|
super buffer
|
67
57
|
else
|
@@ -74,7 +64,7 @@ module HTTP
|
|
74
64
|
def unpack
|
75
65
|
if padded?
|
76
66
|
padding_size = @payload[0].ord
|
77
|
-
data_size = @payload.bytesize - 1 - padding_size
|
67
|
+
data_size = (@payload.bytesize - 1) - padding_size
|
78
68
|
|
79
69
|
if data_size < 0
|
80
70
|
raise ProtocolError, "Invalid padding length: #{padding_size}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http-protocol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-hpack
|