Bug 1464917 - Allow maxPacketLifeTime and maxRetransmits to be zero; r?drno draft
authorFelix Weinrank <weinrank@fh-muenster.de>
Thu, 31 May 2018 09:49:24 -0400
changeset 802797 032aa6eef17d
parent 802102 763f30c34212
child 802798 7d3f3515c8ec
push id111963
push userbmo:dminor@mozilla.com
push dateFri, 01 Jun 2018 13:44:22 +0000
reviewersdrno
bugs1464917
milestone62.0a1
Bug 1464917 - Allow maxPacketLifeTime and maxRetransmits to be zero; r?drno MozReview-Commit-ID: HtYGXPy6pZ
dom/media/PeerConnection.js
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -1576,19 +1576,19 @@ class RTCPeerConnection {
     }
     if (maxPacketLifeTime !== undefined && maxRetransmits !== undefined) {
       throw new this._win.DOMException(
           "Both maxPacketLifeTime and maxRetransmits cannot be provided",
           "InvalidParameterError");
     }
     // Must determine the type where we still know if entries are undefined.
     let type;
-    if (maxPacketLifeTime) {
+    if (maxPacketLifeTime !== undefined) {
       type = Ci.IPeerConnection.kDataChannelPartialReliableTimed;
-    } else if (maxRetransmits) {
+    } else if (maxRetransmits !== undefined) {
       type = Ci.IPeerConnection.kDataChannelPartialReliableRexmit;
     } else {
       type = Ci.IPeerConnection.kDataChannelReliable;
     }
     // Synchronous since it doesn't block.
     let dataChannel =
       this._impl.createDataChannel(label, protocol, type, ordered,
                                    maxPacketLifeTime, maxRetransmits,