Procházet zdrojové kódy

Fix 'source-add' + 'source-remove' race condition

When source-add and source-remove for the same SSRC arrive just one after
another, SSRC will not be removed as it didn't make it to the remote description
yet.
dev1
paweldomas před 9 roky
rodič
revize
1c31d7bfab
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6
    0
      modules/xmpp/JingleSessionPC.js

+ 6
- 0
modules/xmpp/JingleSessionPC.js Zobrazit soubor

@@ -802,6 +802,12 @@ JingleSessionPC.prototype.removeSource = function (elem) {
802 802
                 var ssrcLines = SDPUtil.find_lines(media, 'a=ssrc:' + ssrc);
803 803
                 if (ssrcLines.length)
804 804
                     self.removessrc[idx] += ssrcLines.join("\r\n")+"\r\n";
805
+                // Clear any pending 'source-add' for this SSRC 
806
+                if (self.addssrc[idx]) {
807
+                    self.addssrc[idx]
808
+                        = self.addssrc[idx].replace(
809
+                            new RegExp('^a=ssrc:'+ssrc+' .*\r\n', 'gm'), '');
810
+                }
805 811
             });
806 812
             self.removessrc[idx] += lines;
807 813
         });

Načítá se…
Zrušit
Uložit