tls: fix performance issue
See https://github.com/orangemocha/node-connection-drop
I have pinpointed the performance degradation to
ac2263b77f
This change brings performance back to the orginal levels.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
parent
e86c9421ef
commit
c862c03485
13
lib/tls.js
13
lib/tls.js
@ -510,16 +510,11 @@ CryptoStream.prototype._read = function read(size) {
|
||||
if (this.ondata) {
|
||||
this.ondata(pool, start, start + bytesRead);
|
||||
|
||||
// Deceive streams2
|
||||
var self = this;
|
||||
// Force state.reading to set to false
|
||||
this.push('');
|
||||
|
||||
setImmediate(function() {
|
||||
// Force state.reading to set to false
|
||||
self.push('');
|
||||
|
||||
// Try reading more, we most likely have some data
|
||||
self.read(0);
|
||||
});
|
||||
// Try reading more, we most likely have some data
|
||||
this.read(0);
|
||||
} else {
|
||||
this.push(pool.slice(start, start + bytesRead));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user