Bug 1336507 - Part 3: Make sure mozLocalTransport is set to "tls" where appropriate. r=drno
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 03 Feb 2017 16:48:02 -0600
changeset 479882 31bf2f8302b05449734c5fe6696521db9333c08a
parent 479881 73fb6dab1ea936806d18cbea8012fa20435879a5
child 479883 f3da0505833f946d1b1767986ebb8e3d7a63f5c1
push id44393
push userVYV03354@nifty.ne.jp
push dateTue, 07 Feb 2017 13:53:48 +0000
reviewersdrno
bugs1336507
milestone54.0a1
Bug 1336507 - Part 3: Make sure mozLocalTransport is set to "tls" where appropriate. r=drno MozReview-Commit-ID: EQCKgaFlA3q
media/mtransport/nricemediastream.cpp
--- a/media/mtransport/nricemediastream.cpp
+++ b/media/mtransport/nricemediastream.cpp
@@ -86,17 +86,21 @@ static bool ToNrIceAddr(nr_transport_add
   r = nr_transport_addr_get_port(&addr, &port);
   if (r)
     return false;
 
   out->port = port;
 
   switch (addr.protocol) {
     case IPPROTO_TCP:
-      out->transport = kNrIceTransportTcp;
+      if (addr.tls_host[0] != '\0') {
+        out->transport = kNrIceTransportTls;
+      } else {
+        out->transport = kNrIceTransportTcp;
+      }
       break;
     case IPPROTO_UDP:
       out->transport = kNrIceTransportUdp;
       break;
     default:
       MOZ_CRASH();
       return false;
   }