Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Fixup commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dnakamura committed Jul 10, 2015
1 parent 585062a commit 5f0c458
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ Socket.prototype._destroy = function(exception, cb) {
if (cb) cb(exception);
if (exception && !self._writableState.errorEmitted) {
process.nextTick(function() {
for(var s = self; s !== null; s = s._parent)
for (var s = self; s !== null; s = s._parent)
s.emit('error', exception);
});
self._writableState.errorEmitted = true;
Expand All @@ -482,21 +482,21 @@ Socket.prototype._destroy = function(exception, cb) {
var isException = exception ? true : false;
this._handle.close(function() {
debug('emit close');
for(var s = self; s !== null; s = s._parent)
for (var s = self; s !== null; s = s._parent)
s.emit('close', isException);
});
this._handle.onread = noop;
for(var s = this; s !== null; s = s._parent){
for (var s = this; s !== null; s = s._parent)
s._handle = null;
}

}

// we set destroyed to true before firing error callbacks in order
// to make it re-entrance safe in case Socket.prototype.destroy()
// is called within callbacks
for(var s = this; s !== null; s = s._parent){
for (var s = this; s !== null; s = s._parent)
s.destroyed = true;
}


fireErrorCallbacks();

Expand Down

0 comments on commit 5f0c458

Please sign in to comment.