Skip to content

Commit

Permalink
get tests running in 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Apr 23, 2014
1 parent 1612548 commit 9b3f904
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -6,6 +6,6 @@ node_js:
notifications:
email:
recipients:
- andris@node.ee
- andris@kreata.ee
on_success: change
on_failure: change
1 change: 1 addition & 0 deletions lib/client.js
Expand Up @@ -554,6 +554,7 @@ SMTPClient.prototype.close = function(){
// Close the socket immediately when connection timed out
closeMethod = "destroy";
}

if(this.socket && this.socket.socket && this.socket.socket[closeMethod] && !this.socket.socket.destroyed){
this.socket.socket[closeMethod]();
}
Expand Down
8 changes: 2 additions & 6 deletions lib/pool.js
Expand Up @@ -127,16 +127,12 @@ SMTPConnectionPool.prototype.close = function(callback){
// for some reason destroying the connections seem to be the only way :S
while(this._connectionsAvailable.length){
connection = this._connectionsAvailable.pop();
if(connection.socket){
connection.socket.destroy();
}
connection.close();
}

while(this._connectionsInUse.length){
connection = this._connectionsInUse.pop();
if(connection.socket){
connection.socket.destroy();
}
connection.close();
}

if(callback){
Expand Down
3 changes: 3 additions & 0 deletions lib/server.js
Expand Up @@ -207,6 +207,9 @@ SMTPServerConnection.prototype._onEnd = function(){
console.log("Connection closed to", this.client.remoteAddress);
}
this.server.connectedClients--;
try{
this.client.end();
}catch(E){}
this.server.emit("close", this.envelope);
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -24,7 +24,7 @@
}
],
"dependencies": {
"rai": "^0.1.10",
"rai": "~0.1.10",
"xoauth2": "~0.1"
},
"devDependencies": {
Expand Down

0 comments on commit 9b3f904

Please sign in to comment.