-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node 11.1.0 onStreamRead params have changed #6
Comments
Any update on this? It's still happening in Node 12.8. |
I had this problem (see issue #363) using node-spdy, I just reversed the parameter order of the function Error encountered :
|
- changed: wip version
Possible solution add: const NODE_MAJOR_VERSION = +process.versions.node.split('.')[0]; Handle.prototype._flow = function flow () {
var self = this
this._stream.on('data', function (chunk) {
if (NODE_MAJOR_VERSION < 11) {
self.onread(chunk.length, chunk)
} else {
self.onread(chunk)
}
})
this._stream.on('end', function () {
if (NODE_MAJOR_VERSION < 11) {
self.onread(uv.UV_EOF, Buffer.alloc(0))
} else {
self.onread(Buffer.alloc(0))
}
})
this._stream.on('close', function () {
setImmediate(function () {
if (self._reading) {
if (NODE_MAJOR_VERSION < 11) {
self.onread(uv.UV_ECONNRESET, Buffer.alloc(0))
} else {
self.onread(Buffer.alloc(0))
}
}
})
})
} also works with versions <11 and> = 11 |
Keeping track of #5 (comment)
The text was updated successfully, but these errors were encountered: