websocket-driver 0.5.3-java → 0.5.4-java

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: 109c1f59f22a771cae5e2f1cdd979b35c502ea15
4
- data.tar.gz: 53e2427e3b644794392c476c1e7be23255c3ca4b
3
+ metadata.gz: 4c6f967537a9e90a5e34627cc7b9738443976081
4
+ data.tar.gz: 7d8b0e815c6bc9fe96d63e397b0af3600df3d3ed
5
5
  SHA512:
6
- metadata.gz: 8b7798d7dfb4d22189d1301e9fa2e7536fb2e7e06a00b0e19065f766a925029b077b85f1f53f35024e0bce2daa670ac7ab97b4b0389055585ba6e84bc01cd1b5
7
- data.tar.gz: 156bce5b21675bfc563338ac3054d8719260ab5a7662fa9e1dfaa1710d5bae479bbf62a97432ff8fe1e122bc4ff6ef3de186578af424a9355f30916adae4edba
6
+ metadata.gz: 617369b8f735060d83e95b573dd17a7ae795675c1f3b056c20416547d884f7d17de56fcde9de9c3daea23d5db1d024dc12d269ff4fa20c2b0aa786d91f829a83
7
+ data.tar.gz: 39f201f433cb3814f3833faef99af9678dc2887c87550343e317e087fc76fb258af32dc9e84dfd07499bbfcb362344b803f48f0d4fef5f6e6a2c01ca12d5617a
@@ -1,3 +1,10 @@
1
+ ### 0.5.4 / 2015-03-29
2
+
3
+ * Don't emit extra close frames if we receive a close frame after we already
4
+ sent one
5
+ * Fail the connection when the driver receives an invalid
6
+ `Sec-WebSocket-Extensions` header
7
+
1
8
  ### 0.5.3 / 2015-02-22
2
9
 
3
10
  * Don't treat incoming data as WebSocket frames if a client driver is closed
@@ -21,7 +28,8 @@
21
28
 
22
29
  ### 0.3.5 / 2014-10-04
23
30
 
24
- * Fix bug where the `Server` driver doesn't pass `ping` callbacks to its delegate
31
+ * Fix bug where the `Server` driver doesn't pass `ping` callbacks to its
32
+ delegate
25
33
  * Fix an arity error when calling `fail_request`
26
34
  * Allow `close` to be called before `start` to close the driver
27
35
 
@@ -29,7 +37,8 @@
29
37
 
30
38
  * Don't hold references to frame buffers after a message has been emitted
31
39
  * Make sure that `protocol` and `version` are exposed properly by the TCP driver
32
- * Correct HTTP header parsing based on RFC 7230; header names cannot contain backslashes
40
+ * Correct HTTP header parsing based on RFC 7230; header names cannot contain
41
+ backslashes
33
42
 
34
43
  ### 0.3.3 / 2014-04-24
35
44
 
@@ -39,7 +48,8 @@
39
48
 
40
49
  ### 0.3.2 / 2013-12-29
41
50
 
42
- * Expand `max_length` to cover sequences of continuation frames and `draft-{75,76}`
51
+ * Expand `max_length` to cover sequences of continuation frames and
52
+ `draft-{75,76}`
43
53
  * Decrease default maximum frame buffer size to 64MB
44
54
  * Stop parsing when the protocol enters a failure mode, to save CPU cycles
45
55
 
data/README.md CHANGED
@@ -311,7 +311,7 @@ the headers are serialized and sent.
311
311
 
312
312
  Initiates the protocol by sending the handshake - either the response for a
313
313
  server-side driver or the request for a client-side one. This should be the
314
- first method you invoke. Returns `true` iff a handshake was sent.
314
+ first method you invoke. Returns `true` if and only if a handshake was sent.
315
315
 
316
316
  #### `driver.parse(string)`
317
317
 
@@ -89,7 +89,9 @@ module WebSocket
89
89
 
90
90
  def start
91
91
  return false unless @ready_state == 0
92
- @socket.write(Driver.encode(handshake_response, :binary))
92
+ response = handshake_response
93
+ return false unless response
94
+ @socket.write(Driver.encode(response, :binary))
93
95
  open unless @stage == -1
94
96
  true
95
97
  end
@@ -237,7 +237,13 @@ module WebSocket
237
237
  end
238
238
 
239
239
  def handshake_response
240
- extensions = @extensions.generate_response(@socket.env['HTTP_SEC_WEBSOCKET_EXTENSIONS'])
240
+ begin
241
+ extensions = @extensions.generate_response(@socket.env['HTTP_SEC_WEBSOCKET_EXTENSIONS'])
242
+ rescue => e
243
+ fail(:protocol_error, e.message)
244
+ return nil
245
+ end
246
+
241
247
  @headers['Sec-WebSocket-Extensions'] = extensions if extensions
242
248
 
243
249
  start = 'HTTP/1.1 101 Switching Protocols'
@@ -246,7 +252,7 @@ module WebSocket
246
252
  end
247
253
 
248
254
  def shutdown(code, reason)
249
- frame(reason, :close, code)
255
+ frame(reason, :close, code) if @ready_state < 2
250
256
  @frame = @message = nil
251
257
  @ready_state = 3
252
258
  @stage = 5
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.5.3
4
+ version: 0.5.4
5
5
  platform: java
6
6
  authors:
7
7
  - James Coglan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-22 00:00:00.000000000 Z
11
+ date: 2015-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket-extensions
@@ -87,30 +87,30 @@ extensions: []
87
87
  extra_rdoc_files:
88
88
  - README.md
89
89
  files:
90
- - README.md
91
90
  - CHANGELOG.md
92
- - ext/websocket-driver/websocket_mask.c
91
+ - README.md
92
+ - examples/tcp_server.rb
93
93
  - ext/websocket-driver/WebsocketMaskService.java
94
94
  - ext/websocket-driver/extconf.rb
95
- - examples/tcp_server.rb
95
+ - ext/websocket-driver/websocket_mask.c
96
96
  - lib/websocket/driver.rb
97
- - lib/websocket/http.rb
98
- - lib/websocket/websocket_mask.rb
99
97
  - lib/websocket/driver/client.rb
100
98
  - lib/websocket/driver/draft75.rb
101
99
  - lib/websocket/driver/draft76.rb
102
100
  - lib/websocket/driver/event_emitter.rb
103
101
  - lib/websocket/driver/headers.rb
104
102
  - lib/websocket/driver/hybi.rb
105
- - lib/websocket/driver/proxy.rb
106
- - lib/websocket/driver/server.rb
107
- - lib/websocket/driver/utf8_match.rb
108
103
  - lib/websocket/driver/hybi/frame.rb
109
104
  - lib/websocket/driver/hybi/message.rb
110
105
  - lib/websocket/driver/hybi/stream_reader.rb
106
+ - lib/websocket/driver/proxy.rb
107
+ - lib/websocket/driver/server.rb
108
+ - lib/websocket/driver/utf8_match.rb
109
+ - lib/websocket/http.rb
111
110
  - lib/websocket/http/headers.rb
112
111
  - lib/websocket/http/request.rb
113
112
  - lib/websocket/http/response.rb
113
+ - lib/websocket/websocket_mask.rb
114
114
  - lib/websocket_mask.jar
115
115
  homepage: http://github.com/faye/websocket-driver-ruby
116
116
  licenses:
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.1.9
139
+ rubygems_version: 2.4.5
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: WebSocket protocol handler with pluggable I/O