|
@@ -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
|
|
|
});
|