Permalink
Browse files

zlib: Emit "end" instead of "close" for Z_STREAM_END

Emit "end" instead of "close" when Z_STREAM_END return value is
encountered. And remove emitting "end" in Zlib.end().
  • Loading branch information...
1 parent 45cb346 commit 3efc53209fc214c936c027f02587f21c5bcbfe1a @npcode committed Jul 20, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/zlib.js
View
3 lib/zlib.js
@@ -346,7 +346,6 @@ Zlib.prototype.end = function end(chunk, cb) {
var self = this;
this._ending = true;
var ret = this.write(chunk, function() {
- self.emit('end');
if (cb) cb();
});
this._ended = true;
@@ -440,7 +439,7 @@ Zlib.prototype._process = function() {
self._process();
if (err == binding.Z_STREAM_END) {
- self.emit('close');
+ self.emit('end');
}
}
};

0 comments on commit 3efc532

Please sign in to comment.