protocol-websocket 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/protocol/websocket/frame.rb +5 -5
- data/lib/protocol/websocket/version.rb +1 -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: fa6f686dc5e613876cef1283788d5be3894e069243e542f046474b332fbf95dd
|
4
|
+
data.tar.gz: ee086548d5f7346510acb18ec2dcb2238f869e5a84e806a21a46ddd341a83a59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz: '
|
6
|
+
metadata.gz: 818fb24badcacf322da7eb6a5b9f4d33a1825a05dd745e83d92917eccdd663ddc1a1f7d3eaa93bdfe10f2c3af75b6abac991da5f9ee8ee2c9281e02d1f25402e
|
7
|
+
data.tar.gz: '0857e0a599e4b391d265c61efee3555b7d75c6c6b6c0f83ee691e8d413ab971fc47c8d07300ca6815c589f22d12abbdffafc0911bde93eb5670eba120b8478a9'
|
@@ -131,17 +131,17 @@ module Protocol
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def self.read(finished, opcode, stream, maximum_frame_size)
|
134
|
-
buffer = stream.read(1) or raise EOFError
|
134
|
+
buffer = stream.read(1) or raise EOFError, "Could not read header!"
|
135
135
|
byte = buffer.unpack("C").first
|
136
136
|
|
137
137
|
mask = (byte & 0b1000_0000 != 0)
|
138
138
|
length = byte & 0b0111_1111
|
139
139
|
|
140
140
|
if length == 126
|
141
|
-
buffer = stream.read(2) or raise EOFError
|
141
|
+
buffer = stream.read(2) or raise EOFError, "Could not read length!"
|
142
142
|
length = buffer.unpack('n').first
|
143
143
|
elsif length == 127
|
144
|
-
buffer = stream.read(4) or raise EOFError
|
144
|
+
buffer = stream.read(4) or raise EOFError, "Could not read length!"
|
145
145
|
length = buffer.unpack('Q>').first
|
146
146
|
end
|
147
147
|
|
@@ -150,10 +150,10 @@ module Protocol
|
|
150
150
|
end
|
151
151
|
|
152
152
|
if mask
|
153
|
-
mask = stream.read(4) or raise EOFError
|
153
|
+
mask = stream.read(4) or raise EOFError, "Could not read mask!"
|
154
154
|
end
|
155
155
|
|
156
|
-
payload = stream.read(length) or raise EOFError
|
156
|
+
payload = stream.read(length) or raise EOFError, "Could not read payload!"
|
157
157
|
|
158
158
|
if payload.bytesize != length
|
159
159
|
raise EOFError, "Incorrect payload length: #{@length} != #{@payload.bytesize}!"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-websocket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: protocol-http
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubygems_version: 3.0.
|
143
|
+
rubygems_version: 3.0.3
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: A low level implementation of the WebSocket protocol.
|