From e20c74789a544facd5380c5b1655262a85556156 Mon Sep 17 00:00:00 2001 From: Michelle Bu Date: Thu, 7 Feb 2013 12:25:56 -0800 Subject: [PATCH] small thing --- lib/server.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/server.js b/lib/server.js index 4acea25..180a84c 100644 --- a/lib/server.js +++ b/lib/server.js @@ -270,7 +270,7 @@ PeerServer.prototype._handleTransmission = function(message, res) { type: 'EXPIRE', src: dst, dst: src - }); + }); } }, this._options.timeout); } @@ -279,10 +279,11 @@ PeerServer.prototype._handleTransmission = function(message, res) { } else if (type === 'LEAVE' && !dst) { this._removePeer(src); if (!!res) res.send(200); - } else { + } else if (src) { // Assume a disconnect if the client no longer exists. + // Unless it's a message from the server. this._handleTransmission({ - type: 'LEAVE', + type: 'EXPIRE', src: dst, dst: src });