Skip to content

Commit

Permalink
Upgraded connections didn't have an error handler properly installed,…
Browse files Browse the repository at this point in the history
… causing uncaught exceptions.
  • Loading branch information
kenpratt committed Jun 4, 2013
1 parent 889b2b6 commit c3b63f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/client.js
Expand Up @@ -171,6 +171,7 @@ SMTPClient.prototype.connect = function(){
SMTPClient.prototype._upgradeConnection = function(callback){
this._ignoreData = true;
this.socket.removeAllListeners("data");
this.socket.removeAllListeners("error");

var opts = {
socket: this.socket,
Expand All @@ -189,6 +190,7 @@ SMTPClient.prototype._upgradeConnection = function(callback){

return callback(null, true);
}).bind(this));
this.socket.on("error", this._onError.bind(this));
};

/**
Expand Down

0 comments on commit c3b63f3

Please sign in to comment.