Backed out changeset e7b0bdaa0661 (bug 1295552) for GTest crashed @mozilla::NrIceCtxHandler::CreateCtx
authorIris Hsiao <ihsiao@mozilla.com>
Mon, 22 Aug 2016 11:11:05 +0800
changeset 310434 9f442b970ac15c3a66640762c0ce0d10a12350e1
parent 310433 d16d42082abf5a0251baef11ce2913828f653b2b
child 310435 faf614ed04be0552a801ece4542a9647caa86d5d
push id31567
push userihsiao@mozilla.com
push dateMon, 22 Aug 2016 03:11:23 +0000
treeherderautoland@9f442b970ac1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1295552
milestone51.0a1
backs oute7b0bdaa066136d891655210960e5ce9aff34bb7
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset e7b0bdaa0661 (bug 1295552) for GTest crashed @mozilla::NrIceCtxHandler::CreateCtx
media/mtransport/nricectxhandler.cpp
media/mtransport/third_party/nICEr/src/ice/ice_ctx.c
media/mtransport/third_party/nICEr/src/ice/ice_ctx.h
--- a/media/mtransport/nricectxhandler.cpp
+++ b/media/mtransport/nricectxhandler.cpp
@@ -6,17 +6,16 @@
 extern "C" {
 #include "nr_api.h"
 #include "ice_ctx.h"
 }
 
 // Local includes
 #include "nricectxhandler.h"
 #include "nricemediastream.h"
-#include "nriceresolver.h"
 
 namespace mozilla {
 
 MOZ_MTLOG_MODULE("mtransport")
 
 NrIceCtxHandler::NrIceCtxHandler(const std::string& name,
                                  bool offerer,
                                  NrIceCtx::Policy policy)
@@ -81,46 +80,16 @@ NrIceCtxHandler::CreateCtx(const std::st
   if (new_ctx == nullptr) {
     return nullptr;
   }
 
   if (!new_ctx->Initialize(hide_non_default, ufrag, pwd)) {
     return nullptr;
   }
 
-  // copy the stun, and turn servers from the current context
-  int r = nr_ice_ctx_set_stun_servers(new_ctx->ctx_,
-                                      this->current_ctx->ctx_->stun_servers,
-                                      this->current_ctx->ctx_->stun_server_ct);
-  if (r) {
-    MOZ_MTLOG(ML_ERROR, "Error while setting STUN servers in CreateCtx"
-                        << " (likely ice restart related)");
-    return nullptr;
-  }
-
-  r = nr_ice_ctx_copy_turn_servers(new_ctx->ctx_,
-                                   this->current_ctx->ctx_->turn_servers,
-                                   this->current_ctx->ctx_->turn_server_ct);
-  if (r) {
-    MOZ_MTLOG(ML_ERROR, "Error while copying TURN servers in CreateCtx"
-                        << " (likely ice restart related)");
-    return nullptr;
-  }
-
-  // grab the NrIceResolver stashed in the nriceresolver and allocate another
-  // for the new ctx
-  NrIceResolver* resolver =
-    static_cast<NrIceResolver*>(this->current_ctx->ctx_->resolver->obj);
-  if (!resolver ||
-      NS_FAILED(new_ctx->SetResolver(resolver->AllocateResolver()))) {
-    MOZ_MTLOG(ML_ERROR, "Error while setting dns resolver in CreateCtx"
-                        << " (likely ice restart related)");
-    return nullptr;
-  }
-
   return new_ctx;
 }
 
 
 bool
 NrIceCtxHandler::BeginIceRestart(RefPtr<NrIceCtx> new_ctx)
 {
   MOZ_ASSERT(!old_ctx, "existing ice restart in progress");
--- a/media/mtransport/third_party/nICEr/src/ice/ice_ctx.c
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_ctx.c
@@ -163,41 +163,16 @@ int nr_ice_ctx_set_turn_servers(nr_ice_c
       ctx->turn_server_ct = ct;
     }
 
     _status=0;
  abort:
     return(_status);
   }
 
-int nr_ice_ctx_copy_turn_servers(nr_ice_ctx *ctx, nr_ice_turn_server *servers, int ct)
-  {
-    int _status, i, r;
-
-    if (r = nr_ice_ctx_set_turn_servers(ctx, servers, ct)) {
-      ABORT(r);
-    }
-
-    // make copies of the username and password so they aren't freed twice
-    for (i = 0; i < ct; ++i) {
-      if (!(ctx->turn_servers[i].username = r_strdup(servers[i].username))) {
-        ABORT(R_NO_MEMORY);
-      }
-      if (r = r_data_create(&ctx->turn_servers[i].password,
-                            servers[i].password->data,
-                            servers[i].password->len)) {
-        ABORT(r);
-      }
-    }
-
-    _status=0;
-   abort:
-    return(_status);
-  }
-
 static int nr_ice_ctx_set_local_addrs(nr_ice_ctx *ctx,nr_local_addr *addrs,int ct)
   {
     int _status,i,r;
 
     if(ctx->local_addrs) {
       RFREE(ctx->local_addrs);
       ctx->local_addr_ct=0;
       ctx->local_addrs=0;
--- a/media/mtransport/third_party/nICEr/src/ice/ice_ctx.h
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_ctx.h
@@ -173,17 +173,16 @@ int nr_ice_add_media_stream(nr_ice_ctx *
 int nr_ice_remove_media_stream(nr_ice_ctx *ctx,nr_ice_media_stream **streamp);
 int nr_ice_get_global_attributes(nr_ice_ctx *ctx,char ***attrsp, int *attrctp);
 int nr_ice_ctx_deliver_packet(nr_ice_ctx *ctx, nr_ice_component *comp, nr_transport_addr *source_addr, UCHAR *data, int len);
 int nr_ice_ctx_is_known_id(nr_ice_ctx *ctx, UCHAR id[12]);
 int nr_ice_ctx_remember_id(nr_ice_ctx *ctx, nr_stun_message *msg);
 int nr_ice_ctx_finalize(nr_ice_ctx *ctx, nr_ice_peer_ctx *pctx);
 int nr_ice_ctx_set_stun_servers(nr_ice_ctx *ctx,nr_ice_stun_server *servers, int ct);
 int nr_ice_ctx_set_turn_servers(nr_ice_ctx *ctx,nr_ice_turn_server *servers, int ct);
-int nr_ice_ctx_copy_turn_servers(nr_ice_ctx *ctx, nr_ice_turn_server *servers, int ct);
 int nr_ice_ctx_set_resolver(nr_ice_ctx *ctx, nr_resolver *resolver);
 int nr_ice_ctx_set_interface_prioritizer(nr_ice_ctx *ctx, nr_interface_prioritizer *prioritizer);
 int nr_ice_ctx_set_turn_tcp_socket_wrapper(nr_ice_ctx *ctx, nr_socket_wrapper_factory *wrapper);
 void nr_ice_ctx_set_socket_factory(nr_ice_ctx *ctx, nr_socket_factory *factory);
 int nr_ice_ctx_set_trickle_cb(nr_ice_ctx *ctx, nr_ice_trickle_candidate_cb cb, void *cb_arg);
 int nr_ice_ctx_hide_candidate(nr_ice_ctx *ctx, nr_ice_candidate *cand);
 int nr_ice_get_new_ice_ufrag(char** ufrag);
 int nr_ice_get_new_ice_pwd(char** pwd);