websocket-driver 0.6.4-java → 0.6.5-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ca9e841dbce35de07a9afcd29d6f0660d01a68c
4
- data.tar.gz: c1729d6498efc70411f686ce2389985df7d0be55
3
+ metadata.gz: dcd1cd3f4fbfa7dcdcd3ec1a5190165abc4072bb
4
+ data.tar.gz: 71104f9f20b82cbd2677ed13cdeb9c71790a26aa
5
5
  SHA512:
6
- metadata.gz: b9e54bfd44ef74195ef0951816a6db18b4ec0fdadd7327d5d42e65ec02ab8847cb72a1b25cc136d61c324c741c46c7295abb24c637bd231a9420b50bb7ccfd5f
7
- data.tar.gz: 459bb5004b7960ba06da380d716279a784c89a1ab28dead9b252e0b1bdfb38825ad17a1ae6d4afc446dd200cb316655e12ea67f0d4bdf4735c68395547e2528a
6
+ metadata.gz: 7bfe24e050a4f5b342328af911fbdfe260c0e22ec933f2b56bae8657dc50a08ce77c6c3622be18432dc0da44a9eb2be67df494402c9736029864a10f0725ea6f
7
+ data.tar.gz: bb1f533ae8da678e7d81142fdc65a4d38e4835782b859183919ed97568636e58c2f1feb289b0e40ce67e7469a0990bd42297fb19680dbcebd9ee07ae38b045d3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.6.5 / 2017-01-22
2
+
3
+ * Provide a pure-Ruby fallback for the native unmasking code
4
+
1
5
  ### 0.6.4 / 2016-05-20
2
6
 
3
7
  * Amend warnings issued when running with -W2
data/LICENSE.md ADDED
@@ -0,0 +1,22 @@
1
+ # License
2
+
3
+ (The MIT License)
4
+
5
+ Copyright (c) 2010-2017 James Coglan
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
8
+ this software and associated documentation files (the 'Software'), to deal in
9
+ the Software without restriction, including without limitation the rights to
10
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11
+ the Software, and to permit persons to whom the Software is furnished to do so,
12
+ subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -367,27 +367,3 @@ Returns the WebSocket version in use as a string. Will either be `hixie-75`,
367
367
  Returns a string containing the selected subprotocol, if any was agreed upon
368
368
  using the `Sec-WebSocket-Protocol` mechanism. This value becomes available after
369
369
  `emit('open')` has fired.
370
-
371
-
372
- ## License
373
-
374
- (The MIT License)
375
-
376
- Copyright (c) 2010-2016 James Coglan
377
-
378
- Permission is hereby granted, free of charge, to any person obtaining a copy of
379
- this software and associated documentation files (the 'Software'), to deal in
380
- the Software without restriction, including without limitation the rights to
381
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
382
- the Software, and to permit persons to whom the Software is furnished to do so,
383
- subject to the following conditions:
384
-
385
- The above copyright notice and this permission notice shall be included in all
386
- copies or substantial portions of the Software.
387
-
388
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
389
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
390
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
391
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
392
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
393
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -19,7 +19,15 @@ module WebSocket
19
19
  class Driver
20
20
 
21
21
  root = File.expand_path('../driver', __FILE__)
22
- require 'websocket_mask'
22
+
23
+ begin
24
+ # Load C native extension
25
+ require 'websocket_mask'
26
+ rescue LoadError
27
+ # Fall back to pure-Ruby implementation
28
+ require 'websocket/mask'
29
+ end
30
+
23
31
 
24
32
  if RUBY_PLATFORM =~ /java/
25
33
  require 'jruby'
@@ -0,0 +1,14 @@
1
+ module WebSocket
2
+ module Mask
3
+ def self.mask(payload, mask)
4
+ return payload if mask.nil? || payload.empty?
5
+
6
+ payload.tap do |result|
7
+ payload.bytesize.times do |i|
8
+ result.setbyte(i, payload.getbyte(i) ^ mask.getbyte(i % 4))
9
+ end
10
+ end
11
+ end
12
+
13
+ end
14
+ end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websocket-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: java
6
6
  authors:
7
7
  - James Coglan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-20 00:00:00.000000000 Z
11
+ date: 2017-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket-extensions
@@ -88,6 +88,7 @@ extra_rdoc_files:
88
88
  - README.md
89
89
  files:
90
90
  - CHANGELOG.md
91
+ - LICENSE.md
91
92
  - README.md
92
93
  - examples/tcp_server.rb
93
94
  - ext/websocket-driver/WebsocketMaskService.java
@@ -109,6 +110,7 @@ files:
109
110
  - lib/websocket/http/headers.rb
110
111
  - lib/websocket/http/request.rb
111
112
  - lib/websocket/http/response.rb
113
+ - lib/websocket/mask.rb
112
114
  - lib/websocket/websocket_mask.rb
113
115
  - lib/websocket_mask.jar
114
116
  homepage: http://github.com/faye/websocket-driver-ruby