Bug 1340734: Move the TLS detection logic to TestNrSocket::create, to keep up with changes from bug 1336507. r=drno
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 17 Feb 2017 17:31:55 -0600
changeset 373056 2ad5216e9145d3f9941fe005237db8fad4365126
parent 373055 2cec05d38d05cd69de0edf6b4454c8ba1cdc61cf
child 373057 e6e6e6ceb9c95d8663ee82353d44b35decb41714
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs1340734, 1336507
milestone54.0a1
Bug 1340734: Move the TLS detection logic to TestNrSocket::create, to keep up with changes from bug 1336507. r=drno MozReview-Commit-ID: A0wYXBmvhyh
media/mtransport/test_nr_socket.cpp
--- a/media/mtransport/test_nr_socket.cpp
+++ b/media/mtransport/test_nr_socket.cpp
@@ -244,16 +244,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() {
@@ -472,20 +476,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);
   }