Bug 1320150: only fire consent when previously connected. r=mjf
MozReview-Commit-ID: 4cj5gta8uet
--- 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;