Bug 1320150: only fire consent when previously connected. r=mjf draft
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Thu, 24 Nov 2016 00:01:44 -0800
changeset 443606 984b7ba3d75f9a25d8644db84d22fa97aac950d5
parent 443004 47f42f21541b9b98ad7db82edb996b29065debd0
child 538082 cb0043e276ae99b8aebab619f855538f20a5c89f
push id37025
push userdrno@ohlmeier.org
push dateThu, 24 Nov 2016 17:25:18 +0000
reviewersmjf
bugs1320150
milestone53.0a1
Bug 1320150: only fire consent when previously connected. r=mjf 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;