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 032aa6eef17db8a918002684f4d5f959e29b185b
parent 802102 763f30c3421233a45ef9e67a695c5c241a2c8a3a
child 802798 7d3f3515c8ec3db1e0d41ca084a397c30e09322e
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,