(sock)
| 355 | } |
| 356 | |
| 357 | _readData(sock) { |
| 358 | if (this._len === 0) { |
| 359 | if (sock.rQwait("TIGHT", 3)) { |
| 360 | return null; |
| 361 | } |
| 362 | |
| 363 | let byte; |
| 364 | |
| 365 | byte = sock.rQshift8(); |
| 366 | this._len = byte & 0x7f; |
| 367 | if (byte & 0x80) { |
| 368 | byte = sock.rQshift8(); |
| 369 | this._len |= (byte & 0x7f) << 7; |
| 370 | if (byte & 0x80) { |
| 371 | byte = sock.rQshift8(); |
| 372 | this._len |= byte << 14; |
| 373 | } |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | if (sock.rQwait("TIGHT", this._len)) { |
| 378 | return null; |
| 379 | } |
| 380 | |
| 381 | let data = sock.rQshiftBytes(this._len, false); |
| 382 | this._len = 0; |
| 383 | |
| 384 | return data; |
| 385 | } |
| 386 | |
| 387 | _getScratchBuffer(size) { |
| 388 | if (!this._scratchBuffer || (this._scratchBuffer.length < size)) { |
no test coverage detected