mirror of https://github.com/nodejs/node.git
tls: fix sporadic hang and partial reads
Do not decrement size in read loop, its used later, when comparing to `bytesRead`. fix #6270 NOTE: Original patch contributed by @roadrunner2archived-io.js-v0.10
parent
cfa03ad2e3
commit
671b5be6e9
|
@ -447,10 +447,9 @@ CryptoStream.prototype._read = function read(size) {
|
|||
var bytesRead = 0,
|
||||
start = this._buffer.offset;
|
||||
do {
|
||||
var read = this._buffer.use(this.pair.ssl, out, size);
|
||||
var read = this._buffer.use(this.pair.ssl, out, size - bytesRead);
|
||||
if (read > 0) {
|
||||
bytesRead += read;
|
||||
size -= read;
|
||||
}
|
||||
|
||||
// Handle and report errors
|
||||
|
|
Loading…
Reference in New Issue