Переглянути джерело

No need to call close from negotiator cleanup. Fix some text

ericz 11 роки тому
батько
коміт
f119dfc310
2 змінених файлів з 3 додано та 3 видалено
  1. 2 3
      lib/negotiator.js
  2. 1 0
      lib/peer.js

+ 2 - 3
lib/negotiator.js

@@ -133,7 +133,7 @@ Negotiator._setupListeners = function(connection, pc, pc_id) {
       case 'disconnected':
       case 'failed':
         util.log('iceConnectionState is disconnected, closing connections to ' + peerId);
-        Negotiator.cleanup(connection);
+        connection.close();
         break;
       case 'completed':
         pc.onicecandidate = util.noop;
@@ -176,8 +176,7 @@ Negotiator._setupListeners = function(connection, pc, pc_id) {
 }
 
 Negotiator.cleanup = function(connection) {
-  connection.close(); // Will fail safely if connection is already closed.
-  util.log('Cleanup PeerConnection for ' + connection.peer);
+  util.log('Cleaning up PeerConnection to ' + connection.peer);
 
   var pc = connection.pc;
 

+ 1 - 0
lib/peer.js

@@ -160,6 +160,7 @@ Peer.prototype._handleMessage = function(message) {
 
     //
     case 'LEAVE': // Another peer has closed its connection to this peer.
+      util.log('Received leave message from', peer);
       this._cleanupPeer(peer);
       break;