-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix "zlib binding closed" errors #632
Conversation
3f8fbc4
to
80ec7a3
Compare
👍 It might be better to add a guard to |
aec4c52
to
cf1ddec
Compare
@@ -76,10 +76,18 @@ PerMessageDeflate.prototype.accept = function(paramsList) { | |||
|
|||
PerMessageDeflate.prototype.cleanup = function() { | |||
if (this._inflate) { | |||
if (this._inflate.writeInProgress) { | |||
this._inflate.pendingClose = true; | |||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know this codebase, but... I think this means that if there is an _inflate.writeInProgress
when the connection is closed, the _deflate
will never be closed. Instead of returning, this should be rewritten as:
if (this._inflate.writeInProgress) {
this._inflate.pendingClose = true;
} else {
if (this._inflate.close) this._inflate.close();
this._inflate = null;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right! I'll patch this.
cf1ddec
to
4bf5fb8
Compare
👍 Tested & works perfectly. No more
|
Adressing this tomorrow Arnout Kazemier
|
Fix "zlib binding closed" errors
Thanks! That should fix #633 too. |
Hi! @3rd-Eden could you please release this as version 0.8.2 before the big 1.0? 🙏 (the current 0.8.1 is not really usable due to that issue). |
Release of 1.0 goes out tomorrow. No 0.8.2 -- if you have issues, turning off deflate by default Arnout Kazemier
|
Necessary to fix websockets/ws#632
Workaround for this issue: websockets/ws#632 as it has been fixed in the 1.x release that drops support for node 0.10...
This should fix #628, which I think is caused by:
deflate.write()
then triggers an 'error' eventcleanup()
removes the listener attached to the 'error' eventdeflate.flush()
triggers the uncaught error 'zlib binding closed'Does this make any sense?