summaryrefslogtreecommitdiffstats
path: root/nest
diff options
context:
space:
mode:
Diffstat (limited to 'nest')
-rw-r--r--nest/cli.c3
-rw-r--r--nest/cli.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/nest/cli.c b/nest/cli.c
index 41907b3..4ef0f83 100644
--- a/nest/cli.c
+++ b/nest/cli.c
@@ -171,6 +171,7 @@ cli_new(void *priv)
c->event->data = c;
c->tx_buf = c->tx_pos = c->tx_write = NULL;
c->cont = cli_hello;
+ c->cleanup = NULL;
c->last_reply = 0;
c->parser_pool = lp_new(c->pool, 4096);
ev_schedule(c->event);
@@ -194,6 +195,8 @@ cli_written(cli *c)
void
cli_free(cli *c)
{
+ if (c->cleanup)
+ c->cleanup(c);
rfree(c->pool);
}
diff --git a/nest/cli.h b/nest/cli.h
index d4413ff..2d748db 100644
--- a/nest/cli.h
+++ b/nest/cli.h
@@ -29,6 +29,7 @@ typedef struct cli {
struct cli_out *tx_buf, *tx_pos, *tx_write;
event *event;
void (*cont)(struct cli *c);
+ void (*cleanup)(struct cli *c);
void *rover; /* Private to continuation routine */
int last_reply;
struct linpool *parser_pool; /* Pool used during parsing */