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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcd7ca1dcd206844811c34253801a59026273ac68782fa926d806f59dd1bf6ce
4
- data.tar.gz: 2354736794c0a64fcc4ac668e1455cd04aff29027d2f9ec8559286dc95980165
3
+ metadata.gz: fa6f686dc5e613876cef1283788d5be3894e069243e542f046474b332fbf95dd
4
+ data.tar.gz: ee086548d5f7346510acb18ec2dcb2238f869e5a84e806a21a46ddd341a83a59
5
5
  SHA512:
6
- metadata.gz: 53c9f6952570f3c6b1dee4245ca02024b5637f19c14067a8f694a478071357b27d51ab5c61dbd4fa84d080e7a9e119535be32fcfcde6bf783e15892b512801c5
7
- data.tar.gz: '08f16f081b44cb4cfae2f872bf1dd6a2e4ce315d017aaac7796d9312ae2e193343795e38d78d1d9edef8be0bfd5d36fdc4504b5708ed5faebcad718471b70bf9'
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}!"
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Protocol
22
22
  module WebSocket
23
- VERSION = "0.3.1"
23
+ VERSION = "0.3.2"
24
24
  end
25
25
  end
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.1
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-09 00:00:00.000000000 Z
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.2
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.