Skip to content

Commit

Permalink
connection: close connection on transport error
Browse files Browse the repository at this point in the history
This commit forces a connection to close if a transport emits error.
Socket-related errors should have been already doing this, but parse
errors just emitted error events that caused the invalid chunk to be
parsed over and over again if the event was intercepted.

Refs: #76
PR-URL: #78
  • Loading branch information
aqrln committed Feb 20, 2017
1 parent 4a1da4c commit 0ca2e63
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ Connection.prototype._onSocketClose = function() {
// error - error that has occured
//
Connection.prototype._onSocketError = function(error) {
this._end();
this.emit('error', error, this);
};

Expand Down

0 comments on commit 0ca2e63

Please sign in to comment.