protocol-websocket 0.20.0 → 0.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/websocket/connection.rb +1 -1
- data/lib/protocol/websocket/frame.rb +0 -1
- data/lib/protocol/websocket/framer.rb +1 -7
- data/lib/protocol/websocket/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff918f001efdfca622476924df547f137959c0b42c9eb489a6d3252d4e2f111f
|
4
|
+
data.tar.gz: 81a99be831aee6267cf3c2291b945b08a2c4055604ed3a1bab61ddf9b2963c6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a71e45dc30989dcb02c8c3520e827865c7131a7eda8e8c08f0e86b6331c5730017725a4db1abc7f38643342ceeb1aeb906052b98e937ba36dad5c4abc27f8df
|
7
|
+
data.tar.gz: 45309a8c2f2d7d98f49379e7899d01261d90bc7b08a84683b6c3c646570239213a6294149b06a228fd0c2c2b15ffa682b1ac26a45fedd65460b8b1c3ac137a27
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -28,7 +28,7 @@ module Protocol
|
|
28
28
|
# @attribute [Framer] The framer which is used for reading and writing frames.
|
29
29
|
attr :framer
|
30
30
|
|
31
|
-
# @
|
31
|
+
# @attribute [String | Boolean | Nil] The optional mask which is used when generating frames.
|
32
32
|
attr :mask
|
33
33
|
|
34
34
|
# @attribute [Integer] The allowed reserved bits.
|
@@ -23,7 +23,6 @@ module Protocol
|
|
23
23
|
# @parameter mask [Boolean | String] An optional 4-byte string which is used to mask the payload.
|
24
24
|
def initialize(finished = true, payload = nil, flags: 0, opcode: self.class::OPCODE, mask: false)
|
25
25
|
if mask == true
|
26
|
-
# Generate a unique mask for each frame:
|
27
26
|
mask = SecureRandom.bytes(4)
|
28
27
|
end
|
29
28
|
|
@@ -29,11 +29,9 @@ module Protocol
|
|
29
29
|
|
30
30
|
# Wraps an underlying {Async::IO::Stream} for reading and writing binary data into structured frames.
|
31
31
|
class Framer
|
32
|
-
def initialize(stream, frames = FRAMES
|
32
|
+
def initialize(stream, frames = FRAMES)
|
33
33
|
@stream = stream
|
34
34
|
@frames = frames
|
35
|
-
|
36
|
-
@requires_masking = requires_masking
|
37
35
|
end
|
38
36
|
|
39
37
|
# Close the underlying stream.
|
@@ -56,10 +54,6 @@ module Protocol
|
|
56
54
|
klass = @frames[opcode] || Frame
|
57
55
|
frame = klass.read(finished, flags, opcode, @stream, maximum_frame_size)
|
58
56
|
|
59
|
-
if @requires_masking and !frame.mask
|
60
|
-
raise ProtocolError, "Received unmasked frame but requires masking!"
|
61
|
-
end
|
62
|
-
|
63
57
|
return frame
|
64
58
|
end
|
65
59
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|