Bug 1320150: only fire consent when previously connected. r=mjf a=jcristau
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Thu, 24 Nov 2016 00:01:44 -0800
changeset 352756 0277a89270ffd4de69f2b62d4a4fda1ef9db86a8
parent 352755 504fe62668365dd7697f598d2de49ce1fb7632c8
child 352757 ceda318fb493563f2abbfedd5a318831c6ba1248
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf, jcristau
bugs1320150
milestone52.0a2
Bug 1320150: only fire consent when previously connected. r=mjf a=jcristau MozReview-Commit-ID: 4cj5gta8uet
media/mtransport/third_party/nICEr/src/ice/ice_peer_ctx.c
--- a/media/mtransport/third_party/nICEr/src/ice/ice_peer_ctx.c
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_peer_ctx.c
@@ -645,25 +645,29 @@ int nr_ice_peer_ctx_dump_state(nr_ice_pe
     _status=0;
   abort:
     return(_status);
   }
 #endif
 
 void nr_ice_peer_ctx_disconnected(nr_ice_peer_ctx *pctx)
   {
-    if (pctx->handler && pctx->handler->vtbl->ice_disconnected) {
+    if (pctx->reported_connected &&
+        pctx->handler &&
+        pctx->handler->vtbl->ice_disconnected) {
       pctx->handler->vtbl->ice_disconnected(pctx->handler->obj, pctx);
     }
   }
 
 void nr_ice_peer_ctx_connected(nr_ice_peer_ctx *pctx)
   {
     /* Fire the handler callback to say we're done */
-    if (pctx->handler) {
+    if (pctx->reported_connected &&
+        pctx->handler &&
+        pctx->handler->vtbl->ice_connected) {
       pctx->handler->vtbl->ice_connected(pctx->handler->obj, pctx);
     }
   }
 
 static void nr_ice_peer_ctx_fire_connected(NR_SOCKET s, int how, void *cb_arg)
   {
     nr_ice_peer_ctx *pctx=cb_arg;