websocket-driver 0.3.0-java → 0.3.1-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9b4930cf781e61ead71970d79f9d99536002f9ee
4
+ data.tar.gz: bcc865c02dbaac4d97745551eb335d0a3fcd926f
5
+ SHA512:
6
+ metadata.gz: b16704251c817b0e15e783c302ac12868a8e5e891a25e5885449ffff708327bde9f24b0b17abe864e9364689dfdbc1e54a338538131c5ddd76e43a7aead93080
7
+ data.tar.gz: 88578d8f6adfb1c9e21ea82d89e9868cffffed7330b2fceb2ff3d323a3e2639360790751643bcafca0dfb866d88a276980e5047b77eeb37ab263ae0df82c67a4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.3.1 / 2013-12-03
2
+
3
+ * Add a `max_length` option to limit allowed frame size
4
+
1
5
  ### 0.3.0 / 2013-09-09
2
6
 
3
7
  * Support client URLs with Basic Auth credentials
data/README.md CHANGED
@@ -212,6 +212,8 @@ enabled on outgoing frames.
212
212
  The `options` argument is optional, and is a hash. It may contain the following
213
213
  keys:
214
214
 
215
+ * `:max_length` - the maximum allowed size of incoming message frames, in bytes.
216
+ The default value is `2^30 - 1`, or 1 byte short of 1GiB.
215
217
  * `:protocols` - an array of strings representing acceptable subprotocols for
216
218
  use over the socket. The driver will negotiate one of these to use via the
217
219
  `Sec-WebSocket-Protocol` header if supported by the other peer.
@@ -32,6 +32,8 @@ module WebSocket
32
32
  FRAGMENTED_OPCODES = OPCODES.values_at(:continuation, :text, :binary)
33
33
  OPENING_OPCODES = OPCODES.values_at(:text, :binary)
34
34
 
35
+ MAX_LENGTH = 0x3fffffff
36
+
35
37
  ERRORS = {
36
38
  :normal_closure => 1000,
37
39
  :going_away => 1001,
@@ -52,11 +54,12 @@ module WebSocket
52
54
  super
53
55
  reset
54
56
 
55
- @reader = StreamReader.new
56
- @stage = 0
57
- @masking = options[:masking]
58
- @protocols = options[:protocols] || []
59
- @protocols = @protocols.strip.split(/\s*,\s*/) if String === @protocols
57
+ @reader = StreamReader.new
58
+ @stage = 0
59
+ @masking = options[:masking]
60
+ @protocols = options[:protocols] || []
61
+ @protocols = @protocols.strip.split(/\s*,\s*/) if String === @protocols
62
+ @max_length = options[:max_length] || MAX_LENGTH
60
63
 
61
64
  @require_masking = options[:require_masking]
62
65
  @ping_callbacks = {}
@@ -280,6 +283,10 @@ module WebSocket
280
283
  return fail(:protocol_error, "Received control frame having too long payload: #{@length}")
281
284
  end
282
285
 
286
+ if @length > @max_length
287
+ return fail(:too_large, 'WebSocket frame length too large')
288
+ end
289
+
283
290
  @stage = @masked ? 3 : 4
284
291
  end
285
292
 
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websocket-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
5
- prerelease:
4
+ version: 0.3.1
6
5
  platform: java
7
6
  authors:
8
7
  - James Coglan
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-09 00:00:00.000000000 Z
11
+ date: 2013-12-03 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: eventmachine
@@ -18,13 +17,11 @@ dependencies:
18
17
  - - '>='
19
18
  - !ruby/object:Gem::Version
20
19
  version: '0'
21
- none: false
22
20
  requirement: !ruby/object:Gem::Requirement
23
21
  requirements:
24
22
  - - '>='
25
23
  - !ruby/object:Gem::Version
26
24
  version: '0'
27
- none: false
28
25
  prerelease: false
29
26
  type: :development
30
27
  - !ruby/object:Gem::Dependency
@@ -34,13 +31,11 @@ dependencies:
34
31
  - - ~>
35
32
  - !ruby/object:Gem::Version
36
33
  version: 0.8.0
37
- none: false
38
34
  requirement: !ruby/object:Gem::Requirement
39
35
  requirements:
40
36
  - - ~>
41
37
  - !ruby/object:Gem::Version
42
38
  version: 0.8.0
43
- none: false
44
39
  prerelease: false
45
40
  type: :development
46
41
  - !ruby/object:Gem::Dependency
@@ -50,13 +45,11 @@ dependencies:
50
45
  - - '>='
51
46
  - !ruby/object:Gem::Version
52
47
  version: '0'
53
- none: false
54
48
  requirement: !ruby/object:Gem::Requirement
55
49
  requirements:
56
50
  - - '>='
57
51
  - !ruby/object:Gem::Version
58
52
  version: '0'
59
- none: false
60
53
  prerelease: false
61
54
  type: :development
62
55
  description:
@@ -88,7 +81,9 @@ files:
88
81
  - lib/websocket/driver/hybi/stream_reader.rb
89
82
  - lib/websocket_mask.jar
90
83
  homepage: http://github.com/faye/websocket-driver-ruby
91
- licenses: []
84
+ licenses:
85
+ - MIT
86
+ metadata: {}
92
87
  post_install_message:
93
88
  rdoc_options:
94
89
  - --main
@@ -102,17 +97,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
97
  - - '>='
103
98
  - !ruby/object:Gem::Version
104
99
  version: '0'
105
- none: false
106
100
  required_rubygems_version: !ruby/object:Gem::Requirement
107
101
  requirements:
108
102
  - - '>='
109
103
  - !ruby/object:Gem::Version
110
104
  version: '0'
111
- none: false
112
105
  requirements: []
113
106
  rubyforge_project:
114
- rubygems_version: 1.8.24
107
+ rubygems_version: 2.1.9
115
108
  signing_key:
116
- specification_version: 3
109
+ specification_version: 4
117
110
  summary: WebSocket protocol handler with pluggable I/O
118
111
  test_files: []