+12
-29
@@ -72,2 +72,3 @@ 'use strict'; | ||
| this._messageLength = 0; | ||
| this._numFragments = 0; | ||
| this._fragments = []; | ||
@@ -449,2 +450,13 @@ | ||
| if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) { | ||
| this._loop = false; | ||
| return error( | ||
| RangeError, | ||
| 'Too many message fragments', | ||
| false, | ||
| 1008, | ||
| 'WS_ERR_TOO_MANY_BUFFERED_PARTS' | ||
| ); | ||
| } | ||
| if (this._compressed) { | ||
@@ -457,16 +469,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, | ||
| 'WS_ERR_TOO_MANY_BUFFERED_PARTS' | ||
| ); | ||
| } | ||
| // | ||
@@ -510,17 +508,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, | ||
| 'WS_ERR_TOO_MANY_BUFFERED_PARTS' | ||
| ) | ||
| ); | ||
| } | ||
| this._fragments.push(buf); | ||
@@ -527,0 +510,0 @@ } |
@@ -39,5 +39,5 @@ /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^net|tls|https$" }] */ | ||
| * @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 | ||
@@ -60,4 +60,4 @@ * @param {Number} [options.maxPayload=104857600] The maximum allowed message | ||
| options = { | ||
| maxBufferedChunks: 1024 * 1024, | ||
| maxFragments: 128 * 1024, | ||
| maxBufferedChunks: 256 * 1024, | ||
| maxFragments: 16 * 1024, | ||
| maxPayload: 100 * 1024 * 1024, | ||
@@ -64,0 +64,0 @@ perMessageDeflate: false, |
+4
-4
@@ -580,5 +580,5 @@ /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Readable$" }] */ | ||
| * `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 | ||
@@ -596,4 +596,4 @@ * @param {Number} [options.maxPayload=104857600] The maximum allowed message | ||
| protocolVersion: protocolVersions[1], | ||
| maxBufferedChunks: 1024 * 1024, | ||
| maxFragments: 128 * 1024, | ||
| maxBufferedChunks: 256 * 1024, | ||
| maxFragments: 16 * 1024, | ||
| maxPayload: 100 * 1024 * 1024, | ||
@@ -600,0 +600,0 @@ perMessageDeflate: true, |
+1
-1
| { | ||
| "name": "ws", | ||
| "version": "7.5.11", | ||
| "version": "7.5.12", | ||
| "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
124217
-0.3%3624
-0.44%