protocol-websocket 0.12.0 → 0.12.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: 336e62c38fbb57000bf3183e14f750224706504cd8777bbc7d09505f71a0d65e
4
- data.tar.gz: 2bb63e4bab32ba833f90e5f2857ae198a4f0b9aa66404044ac192e9bcc04c726
3
+ metadata.gz: 48ab5e17dd31fff02afee7770e13982923252d35c0e78f0f8b12f35d6d34ff2a
4
+ data.tar.gz: 5cfe56a5875410c6190f65928ea4b0897abccb66981581b46271e9bd8b2d72a1
5
5
  SHA512:
6
- metadata.gz: eba17e42ae64f93fd5d427245b916fb25c6c09971db2d15969d6b8e29aaea22fb1ab39d52aff19fb46157003bf5c277b0aab1194f00a3fc04532fb1bfa1ab3ca
7
- data.tar.gz: e228e38de1c954c9c7c506bc73c94194eea02bb51ee5d0baaae61b98820f831a409970c00a74846a70d0a7642ea807d7e6c09734c388d9634379f0e1bef659cc
6
+ metadata.gz: 7f558e9e5b5f4a1d83cc1cfa298b5a4edef48a0fc256b4ba949ce8d10db66a9c7df9db1b68cf083e46b340984f7c1575b745b8f0a81c45a66a63405ff703d11e
7
+ data.tar.gz: 9e3f2863933129185d723c256ac2d1ad1086e357ae4028f05dc2b1d746b9e8e29d5e57ee98148e2f045997eb1acfbfe1c7e1ff325d2815a3ad75b145fe2590c1
checksums.yaml.gz.sig CHANGED
Binary file
@@ -54,21 +54,29 @@ module Protocol
54
54
  attr :context_takeover
55
55
 
56
56
  def pack_text_frame(buffer, compress: true, **options)
57
- buffer = self.deflate(buffer)
57
+ if compress
58
+ buffer = self.deflate(buffer)
59
+ end
58
60
 
59
61
  frame = @parent.pack_text_frame(buffer, **options)
60
62
 
61
- frame.flags |= Frame::RSV1
63
+ if compress
64
+ frame.flags |= Frame::RSV1
65
+ end
62
66
 
63
67
  return frame
64
68
  end
65
69
 
66
70
  def pack_binary_frame(buffer, compress: false, **options)
67
- buffer = self.deflate(buffer)
71
+ if compress
72
+ buffer = self.deflate(buffer)
73
+ end
68
74
 
69
75
  frame = @parent.pack_binary_frame(buffer, **options)
70
76
 
71
- frame.flags |= Frame::RSV1
77
+ if compress
78
+ frame.flags |= Frame::RSV1
79
+ end
72
80
 
73
81
  return frame
74
82
  end
@@ -54,12 +54,11 @@ module Protocol
54
54
 
55
55
  frame = frames.first
56
56
 
57
- if frame.flags & Frame::RSV1
57
+ if frame.flag?(Frame::RSV1)
58
58
  buffer = self.inflate(buffer)
59
+ frame.flags &= ~Frame::RSV1
59
60
  end
60
61
 
61
- frame.flags &= ~Frame::RSV1
62
-
63
62
  return buffer
64
63
  end
65
64
 
@@ -34,6 +34,10 @@ module Protocol
34
34
  @payload = payload
35
35
  end
36
36
 
37
+ def flag?(value)
38
+ @flags & value != 0
39
+ end
40
+
37
41
  def <=> other
38
42
  to_ary <=> other.to_ary
39
43
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module WebSocket
8
- VERSION = "0.12.0"
8
+ VERSION = "0.12.1"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -17,3 +17,11 @@ We welcome contributions to this project.
17
17
  3. Commit your changes (`git commit -am 'Add some feature'`).
18
18
  4. Push to the branch (`git push origin my-new-feature`).
19
19
  5. Create new Pull Request.
20
+
21
+ ### Developer Certificate of Origin
22
+
23
+ This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
24
+
25
+ ### Contributor Covenant
26
+
27
+ This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-websocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -41,7 +41,7 @@ cert_chain:
41
41
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
42
42
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
43
43
  -----END CERTIFICATE-----
44
- date: 2023-07-01 00:00:00.000000000 Z
44
+ date: 2023-10-05 00:00:00.000000000 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: protocol-http
@@ -57,62 +57,6 @@ dependencies:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0.2'
60
- - !ruby/object:Gem::Dependency
61
- name: protocol-http1
62
- requirement: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - "~>"
65
- - !ruby/object:Gem::Version
66
- version: '0.2'
67
- type: :runtime
68
- prerelease: false
69
- version_requirements: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - "~>"
72
- - !ruby/object:Gem::Version
73
- version: '0.2'
74
- - !ruby/object:Gem::Dependency
75
- name: bundler
76
- requirement: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- version: '0'
81
- type: :development
82
- prerelease: false
83
- version_requirements: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
- - !ruby/object:Gem::Dependency
89
- name: covered
90
- requirement: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: '0'
95
- type: :development
96
- prerelease: false
97
- version_requirements: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- - !ruby/object:Gem::Dependency
103
- name: sus
104
- requirement: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: '0.16'
109
- type: :development
110
- prerelease: false
111
- version_requirements: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: '0.16'
116
60
  description:
117
61
  email:
118
62
  executables: []
@@ -161,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
105
  - !ruby/object:Gem::Version
162
106
  version: '0'
163
107
  requirements: []
164
- rubygems_version: 3.5.0.dev
108
+ rubygems_version: 3.4.19
165
109
  signing_key:
166
110
  specification_version: 4
167
111
  summary: A low level implementation of the WebSocket protocol.
metadata.gz.sig CHANGED
Binary file