diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-11-18 23:26:24 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-11-20 13:49:32 +0000 |
commit | 3bae83631029786197545811c87e3b782b058048 (patch) | |
tree | 772dba78984049ed3d3f82febd96f61e3421fb1c /src/libvlr | |
parent | 3ddd7422ea50864bf14c3475f5305e1aef899ceb (diff) |
vlr_subscr_conn_timeout(): don't fire events to discarded fi
Terminating one of the FSM instances may effect termination and deallocation of
the others, as well as the vlr_subscr itself. So, reserve the vlr_subscr
locally, and then dispatch events to exactly those FSM instances that exist.
The changes in expected output in the msc_vlr_tests shows that the subscriber
was deallocated from the first FSM termination, and now sticks around until
we've checked both FSMs are gone.
Change-Id: I56551ecc10f5295fe75944bdde4b583b1b621811
Diffstat (limited to 'src/libvlr')
-rw-r--r-- | src/libvlr/vlr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index 4ef52da4e..59eb37d2f 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -973,8 +973,12 @@ void vlr_subscr_conn_timeout(struct vlr_subscr *vsub) if (!vsub) return; - vlr_loc_update_conn_timeout(vsub->lu_fsm); - vlr_parq_conn_timeout(vsub->proc_arq_fsm); + vlr_subscr_get(vsub); + if (vsub->lu_fsm) + vlr_loc_update_conn_timeout(vsub->lu_fsm); + if (vsub->proc_arq_fsm) + vlr_parq_conn_timeout(vsub->proc_arq_fsm); + vlr_subscr_put(vsub); } struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops) |