diff options
Diffstat (limited to 'nest/proto.c')
-rw-r--r-- | nest/proto.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/nest/proto.c b/nest/proto.c index f8e1ba31..ac0fb232 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -658,8 +658,6 @@ channel_aux_stopped(void *data) else c->in_table = NULL; - rfree(cat->tab->rp); - mb_free(cat); return channel_check_stopped(c); } @@ -668,7 +666,7 @@ static void channel_aux_import_stopped(struct rt_import_request *req) { struct channel_aux_table *cat = SKIP_BACK(struct channel_aux_table, push, req); - ASSERT_DIE(cat->tab->delete_event); + ASSERT_DIE(cat->stop); } static void @@ -677,23 +675,25 @@ channel_aux_export_stopped(struct rt_export_request *req) struct channel_aux_table *cat = SKIP_BACK(struct channel_aux_table, get, req); req->hook = NULL; - if (cat->refeed_pending && !cat->tab->delete_event) + if (cat->refeed_pending && !cat->stop) { cat->refeed_pending = 0; rt_request_export(cat->tab, req); } else - ASSERT_DIE(cat->tab->delete_event); + ASSERT_DIE(cat->stop); } static void channel_aux_stop(struct channel_aux_table *cat) { + cat->stop = 1; + rt_stop_import(&cat->push, channel_aux_import_stopped); rt_stop_export(&cat->get, channel_aux_export_stopped); - cat->tab->delete_event = ev_new_init(cat->tab->rp, channel_aux_stopped, cat); - + cat->tab->deleted = channel_aux_stopped; + cat->tab->del_data = cat; rt_unlock_table(cat->tab); } @@ -886,6 +886,7 @@ channel_setup_in_table(struct channel *c, int best) c->in_table->c = c; c->in_table->tab = rt_setup(c->proto->pool, &cat->tab_cf); + self_link(&c->in_table->tab->n); rt_lock_table(c->in_table->tab); rt_request_import(c->in_table->tab, &c->in_table->push); @@ -928,6 +929,7 @@ channel_setup_out_table(struct channel *c) c->out_table->c = c; c->out_table->tab = rt_setup(c->proto->pool, &cat->tab_cf); + self_link(&c->out_table->tab->n); rt_lock_table(c->out_table->tab); rt_request_import(c->out_table->tab, &c->out_table->push); |