Browse Source

small thing

Michelle Bu 12 years ago
parent
commit
e20c74789a
1 changed files with 4 additions and 3 deletions
  1. 4 3
      lib/server.js

+ 4 - 3
lib/server.js

@@ -270,7 +270,7 @@ PeerServer.prototype._handleTransmission = function(message, res) {
               type: 'EXPIRE',
               type: 'EXPIRE',
               src: dst,
               src: dst,
               dst: src
               dst: src
-            });   
+            });
           }
           }
         }, this._options.timeout);
         }, this._options.timeout);
       }
       }
@@ -279,10 +279,11 @@ PeerServer.prototype._handleTransmission = function(message, res) {
     } else if (type === 'LEAVE' && !dst) {
     } else if (type === 'LEAVE' && !dst) {
       this._removePeer(src);
       this._removePeer(src);
       if (!!res) res.send(200);
       if (!!res) res.send(200);
-    } else {
+    } else if (src) {
       // Assume a disconnect if the client no longer exists.
       // Assume a disconnect if the client no longer exists.
+      // Unless it's a message from the server.
       this._handleTransmission({
       this._handleTransmission({
-        type: 'LEAVE',
+        type: 'EXPIRE',
         src: dst,
         src: dst,
         dst: src
         dst: src
       });
       });