Bug 1340734 - Move the TLS detection logic to TestNrSocket::create, to keep up with changes from bug 1336507. r=drno, a=lizzard
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 17 Feb 2017 17:31:55 -0600
changeset 379075 db6fcf5fe8069a9af951366b15f79eb7742c138a
parent 379074 1e24c5347cdd3d41ffe32382c35fcb665723899f
child 379076 f6424117706001bf9b090b595b990cfde38e8269
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno, lizzard
bugs1340734, 1336507
milestone53.0
Bug 1340734 - Move the TLS detection logic to TestNrSocket::create, to keep up with changes from bug 1336507. r=drno, a=lizzard MozReview-Commit-ID: A0wYXBmvhyh
media/mtransport/test_nr_socket.cpp
--- a/media/mtransport/test_nr_socket.cpp
+++ b/media/mtransport/test_nr_socket.cpp
@@ -242,16 +242,20 @@ RefPtr<NrSocketBase> TestNrSocket::creat
                                 __FUNCTION__, r);
     return nullptr;
   }
 
   return external_socket;
 }
 
 int TestNrSocket::create(nr_transport_addr *addr) {
+  if (addr->tls_host[0] != '\0') {
+    tls_ = true;
+  }
+
   return NrSocketBase::CreateSocket(addr, &internal_socket_);
 }
 
 int TestNrSocket::getaddr(nr_transport_addr *addrp) {
   return internal_socket_->getaddr(addrp);
 }
 
 void TestNrSocket::close() {
@@ -470,20 +474,16 @@ bool TestNrSocket::allow_ingress(const n
 
 int TestNrSocket::connect(nr_transport_addr *addr) {
 
   if (connect_invoked_ || !port_mappings_.empty()) {
     MOZ_CRASH("TestNrSocket::connect() called more than once!");
     return R_INTERNAL;
   }
 
-  if (addr->tls_host[0] != '\0') {
-    tls_ = true;
-  }
-
   if (!nat_->enabled_
       || addr->protocol==IPPROTO_UDP  // Horrible hack to allow default address
                                       // discovery to work. Only works because
                                       // we don't normally connect on UDP.
       || nat_->is_an_internal_tuple(*addr)) {
     // This will set connect_invoked_
     return internal_socket_->connect(addr);
   }