+6
-17
@@ -68,2 +68,3 @@ 'use strict'; | ||
| this._messageLength = 0; | ||
| this._numFragments = 0; | ||
| this._fragments = []; | ||
@@ -357,2 +358,7 @@ | ||
| if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) { | ||
| this._loop = false; | ||
| return error(RangeError, 'Too many message fragments', false, 1008); | ||
| } | ||
| if (this._compressed) { | ||
@@ -365,10 +371,2 @@ this._state = INFLATING; | ||
| if (data.length) { | ||
| if ( | ||
| this._maxFragments > 0 && | ||
| this._fragments.length >= this._maxFragments | ||
| ) { | ||
| this._loop = false; | ||
| return error(RangeError, 'Too many message fragments', false, 1008); | ||
| } | ||
| // | ||
@@ -406,11 +404,2 @@ // This message is not compressed so its lenght is the sum of the payload | ||
| if ( | ||
| this._maxFragments > 0 && | ||
| this._fragments.length >= this._maxFragments | ||
| ) { | ||
| return cb( | ||
| error(RangeError, 'Too many message fragments', false, 1008) | ||
| ); | ||
| } | ||
| this._fragments.push(buf); | ||
@@ -417,0 +406,0 @@ } |
@@ -30,5 +30,5 @@ 'use strict'; | ||
| * @param {String} options.host The hostname where to bind the server | ||
| * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of | ||
| * @param {Number} [options.maxBufferedChunks=262144] The maximum number of | ||
| * buffered data chunks | ||
| * @param {Number} [options.maxFragments=131072] The maximum number of message | ||
| * @param {Number} [options.maxFragments=16384] The maximum number of message | ||
| * fragments | ||
@@ -50,4 +50,4 @@ * @param {Number} options.maxPayload The maximum allowed message size | ||
| { | ||
| maxBufferedChunks: 1024 * 1024, | ||
| maxFragments: 128 * 1024, | ||
| maxBufferedChunks: 256 * 1024, | ||
| maxFragments: 16 * 1024, | ||
| maxPayload: 100 * 1024 * 1024, | ||
@@ -54,0 +54,0 @@ perMessageDeflate: false, |
+4
-4
@@ -445,5 +445,5 @@ 'use strict'; | ||
| * `Sec-WebSocket-Origin` header | ||
| * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of | ||
| * @param {Number} [options.maxBufferedChunks=262144] The maximum number of | ||
| * buffered data chunks | ||
| * @param {Number} [options.maxFragments=131072] The maximum number of message | ||
| * @param {Number} [options.maxFragments=16384] The maximum number of message | ||
| * fragments | ||
@@ -459,4 +459,4 @@ * @param {Number} options.maxPayload The maximum allowed message size | ||
| protocolVersion: protocolVersions[1], | ||
| maxBufferedChunks: 1024 * 1024, | ||
| maxFragments: 128 * 1024, | ||
| maxBufferedChunks: 256 * 1024, | ||
| maxFragments: 16 * 1024, | ||
| maxPayload: 100 * 1024 * 1024, | ||
@@ -463,0 +463,0 @@ perMessageDeflate: true, |
+1
-1
| { | ||
| "name": "ws", | ||
| "version": "6.2.4", | ||
| "version": "6.2.5", | ||
| "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
103517
-0.24%2896
-0.34%