From 51e0930d39565c1d1621f0eefcb185f9966bb827 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 7 Apr 2017 17:35:55 +0200 Subject: [PATCH] start API in villas-pipe --- src/pipe.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pipe.c b/src/pipe.c index 2635b585c..049067749 100644 --- a/src/pipe.c +++ b/src/pipe.c @@ -44,6 +44,8 @@ pthread_t ptid; /**< Parent thread id */ static void quit(int signal, siginfo_t *sinfo, void *ctx) { + int ret; + if (recvv.started) { pthread_cancel(recvv.thread); pthread_join(recvv.thread, NULL); @@ -55,13 +57,11 @@ static void quit(int signal, siginfo_t *sinfo, void *ctx) pthread_join(sendd.thread, NULL); pool_destroy(&sendd.pool); } - - if (node->_vt->start == websocket_start) - web_stop(&sn.web); - - node_stop(node); - node_type_stop(node->_vt); - + + ret = super_node_stop(&sn); + if (ret) + error("Failed to stop super-node"); + super_node_destroy(&sn); info(GRN("Goodbye!")); @@ -207,7 +207,7 @@ int main(int argc, char *argv[]) usage(); exit(EXIT_FAILURE); } - + log_init(&sn.log, level, LOG_ALL); log_start(&sn.log); @@ -224,8 +224,8 @@ int main(int argc, char *argv[]) error("Node '%s' does not exist!", argv[optind+1]); if (node->_vt->start == websocket_start) { - web_init(&sn.web, NULL); /* API is disabled in villas-pipe */ web_start(&sn.web); + api_start(&sn.api); } if (reverse)