Преглед изворни кода

fix(JSPC): do not report gathering time twice

tags/v0.0.2
paweldomas пре 8 година
родитељ
комит
670144e013
1 измењених фајлова са 11 додато и 1 уклоњено
  1. 11
    1
      modules/xmpp/JingleSessionPC.js

+ 11
- 1
modules/xmpp/JingleSessionPC.js Прегледај датотеку

@@ -89,6 +89,15 @@ export default class JingleSessionPC extends JingleSession {
89 89
          */
90 90
         this._gatheringStartedTimestamp = null;
91 91
 
92
+        /**
93
+         * Marks that ICE gathering duration has been reported already. That
94
+         * prevents reporting it again, after eventual 'transport-replace' (JVB
95
+         * conference migration/ICE restart).
96
+         * @type {boolean}
97
+         * @private
98
+         */
99
+        this._gatheringReported = false;
100
+
92 101
         this.lasticecandidate = false;
93 102
         this.closed = false;
94 103
 
@@ -259,7 +268,7 @@ export default class JingleSessionPC extends JingleSession {
259 268
                         }
260 269
                     }
261 270
                 }
262
-            } else {
271
+            } else if (!this._gatheringReported) {
263 272
                 // End of gathering
264 273
                 let eventName = this.isP2P ? 'p2p.ice.' : 'ice.';
265 274
 
@@ -268,6 +277,7 @@ export default class JingleSessionPC extends JingleSession {
268 277
                 Statistics.analytics.sendEvent(
269 278
                     eventName,
270 279
                     { value: now - this._gatheringStartedTimestamp });
280
+                this._gatheringReported = true;
271 281
             }
272 282
             this.sendIceCandidate(candidate);
273 283
         };

Loading…
Откажи
Сачувај