websocket-driver 0.6.1 → 0.6.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
  SHA1:
3
- metadata.gz: 4a069093c87a31c96d30a911bf3855fec2efc384
4
- data.tar.gz: ea4afb6bcd928bdd6075e68da402875d9470b2f9
3
+ metadata.gz: f1bf44c48fb73c1472cc8c5752bc87cd38f545bf
4
+ data.tar.gz: 9a95a47349ec213020574596650c27d50db93fa7
5
5
  SHA512:
6
- metadata.gz: 01272dedc949458909b2b6dc3acab09a12812ac5de1b0e1d44796d8406678de2445cfe11cdc47e52d447022c0ea5f86acae8aa592ed5c2575073f2c065411e1a
7
- data.tar.gz: 9bd6c3e39ede403a35a3388b1593a8866e3b3dc851e15f86f1799f9a1abe8887fd4888733c35573faf13dd603487110928fbd91fd0f2de61aac8c43a5dbf8131
6
+ metadata.gz: ddf6c23ad1b0f2a9f9c5f4f67978efbec3916bb26754941008da6a488ea5b151ddd504664699cbf1bcee422aaea2b860955af9ccd5f257266be33e7f344be2fd
7
+ data.tar.gz: cf55f6a6e0c62790f8b40efa7af9fdb174e354b8a2d14c218a6421f3258c8c2237c38449eb100e53c650191da8df8df35039e6456acf3c783ba2eeccbe79e70a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.6.2 / 2015-07-18
2
+
3
+ * When the peer sends a close frame with no error code, emit 1000
4
+
1
5
  ### 0.6.1 / 2015-07-13
2
6
 
3
7
  * Fix how events are stored in `EventEmitter` to fix a backward-compatibility
@@ -47,6 +47,7 @@ module WebSocket
47
47
  }
48
48
 
49
49
  ERROR_CODES = ERRORS.values
50
+ DEFAULT_ERROR_CODE = 1000
50
51
  MIN_RESERVED_ERROR = 3000
51
52
  MAX_RESERVED_ERROR = 4999
52
53
 
@@ -354,7 +355,7 @@ module WebSocket
354
355
  @message << frame
355
356
 
356
357
  when OPCODES[:close] then
357
- code = (bytesize >= 2) ? 256 * bytes[0] + bytes[1] : nil
358
+ code = (bytesize >= 2) ? payload.unpack(PACK_FORMATS[2]).first : nil
358
359
  reason = (bytesize > 2) ? Driver.encode(bytes[2..-1] || [], :utf8) : nil
359
360
 
360
361
  unless (bytesize == 0) or
@@ -367,7 +368,7 @@ module WebSocket
367
368
  code = ERRORS[:protocol_error]
368
369
  end
369
370
 
370
- shutdown(code, reason || '')
371
+ shutdown(code || DEFAULT_ERROR_CODE, reason || '')
371
372
 
372
373
  when OPCODES[:ping] then
373
374
  frame(payload, :pong)
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.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Coglan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-13 00:00:00.000000000 Z
11
+ date: 2015-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket-extensions