(data)
| 18052 | __privateSet(this, _byteOffset, __privateGet(this, _byteOffset) + chunk.length); |
| 18053 | __privateSet(this, _loop, true); |
| 18054 | this.run(callback); |
| 18055 | } |
| 18056 | /** |
| 18057 | * Runs whenever a new chunk is received. |
| 18058 | * Callback is called whenever there are no more chunks buffering, |
| 18059 | * or not enough bytes are buffered to parse. |
| 18060 | */ |
| 18061 | run(callback) { |
| 18062 | while (__privateGet(this, _loop)) { |
| 18063 | if (__privateGet(this, _state) === parserStates.INFO) { |
| 18064 | if (__privateGet(this, _byteOffset) < 2) { |
| 18065 | return callback(); |
| 18066 | } |
| 18067 | const buffer = this.consume(2); |
| 18068 | const fin = (buffer[0] & 128) !== 0; |
| 18069 | const opcode = buffer[0] & 15; |
| 18070 | const masked = (buffer[1] & 128) === 128; |
| 18071 | const fragmented = !fin && opcode !== opcodes.CONTINUATION; |
| 18072 | const payloadLength = buffer[1] & 127; |
| 18073 | const rsv1 = buffer[0] & 64; |
| 18074 | const rsv2 = buffer[0] & 32; |
| 18075 | const rsv3 = buffer[0] & 16; |
| 18076 | if (!isValidOpcode(opcode)) { |
no test coverage detected