summaryrefslogtreecommitdiff
path: root/nest/proto.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-10-01 15:55:23 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-10-01 15:55:23 +0200
commit961671c0f51693aff34bf3adf5319b35275a86d3 (patch)
tree1eae258f41d0dc67abdc45da6bc16f253a4f23dc /nest/proto.c
parent0db7a1d69c80b1089f10a268ceacb059db41ced8 (diff)
Lib: Add and use ev_new_init()
Diffstat (limited to 'nest/proto.c')
-rw-r--r--nest/proto.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 8a8221a8..7905c9f2 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -291,9 +291,7 @@ channel_do_start(struct channel *c)
add_tail(&c->table->channels, &c->table_node);
c->proto->active_channels++;
- c->feed_event = ev_new(c->proto->pool);
- c->feed_event->data = c;
- c->feed_event->hook = channel_feed_loop;
+ c->feed_event = ev_new_init(c->proto->pool, channel_feed_loop, c);
channel_reset_limit(&c->rx_limit);
channel_reset_limit(&c->in_limit);
@@ -702,9 +700,7 @@ proto_init(struct proto_config *c, node *n)
p->vrf = c->vrf;
insert_node(&p->n, n);
- p->event = ev_new(proto_pool);
- p->event->hook = proto_event;
- p->event->data = p;
+ p->event = ev_new_init(proto_pool, proto_event, p);
PD(p, "Initializing%s", p->disabled ? " [disabled]" : "");