From 6910d50e9b1e80fe758b259149012e7e062eecd0 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Mon, 6 Jun 2016 10:14:12 +0200 Subject: net: make networking code re-entrant - The network instance is now in struct network and does not use any local/static data - A new top-level struct in baresip.c owns the single instance of struct network it is a long-term goal to remove all local/static data from libbaresip and make it fully re-entrant. --- test/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/main.c') diff --git a/test/main.c b/test/main.c index 42e381e..db99328 100644 --- a/test/main.c +++ b/test/main.c @@ -27,6 +27,7 @@ static const struct test tests[] = { TEST(test_cmd), TEST(test_cplusplus), TEST(test_mos), + TEST(test_network), TEST(test_ua_alloc), TEST(test_ua_register), TEST(test_ua_register_dns), @@ -182,6 +183,11 @@ int main(int argc, char *argv[]) err = ENOENT; goto out; } + + err = baresip_init(config, false); + if (err) + goto out; + str_ncpy(config->sip.local, "127.0.0.1:0", sizeof(config->sip.local)); uag_set_exit_handler(ua_exit_handler, NULL); @@ -228,6 +234,8 @@ int main(int argc, char *argv[]) ua_stop_all(true); ua_close(); + baresip_close(); + libre_close(); tmr_debug(); -- cgit v1.2.3