Bug 1464917 - Allow maxPacketLifeTime and maxRetransmits to be zero; r?drno
MozReview-Commit-ID: HtYGXPy6pZ
--- 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,