-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
null reference in cleanup deflate #664
Comments
Weird, there must be some kind of race condition here (with https://github.com/websockets/ws/blob/master/lib/PerMessageDeflate.js#L259), since this._inflate is checked against null value just before: PerMessageDeflate.prototype.cleanup = function() {
if (this._inflate) {
if (this._inflate.writeInProgress) {
this._inflate.pendingClose = true;
} else {
if (this._inflate.close) this._inflate.close(); //L82
this._inflate = null;
}
}
... One quick fix would be to catch any exception here https://github.com/websockets/ws/blob/master/lib/WebSocket.js#L956 if (this.extensions[PerMessageDeflate.extensionName]) {
try {
this.extensions[PerMessageDeflate.extensionName].cleanup(); }
catch (e) {}
} |
I'm seeing the same issue
|
Looks like this might actually be a problem with zlib:
output:
|
I randomly get this error:
TypeError: Cannot read property 'close' of null
at InflateRaw.Zlib.close (zlib.js:469:15)
at PerMessageDeflate.cleanup (ws/lib/PerMessageDeflate.js:82:46)
Can someone have a look at this issue. It looks to me, that something that is already closed get closed again...
The text was updated successfully, but these errors were encountered: