diff options
author | Alfred E. Heggestad <aeh@db.org> | 2016-06-06 10:14:12 +0200 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2016-06-06 10:14:12 +0200 |
commit | 6910d50e9b1e80fe758b259149012e7e062eecd0 (patch) | |
tree | aecd149deed8ae71349e3b2e626e53f57a9c974a /test/main.c | |
parent | 362914f55831f4ad3afd7c0cad8f01f2f8b4892c (diff) |
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.
Diffstat (limited to 'test/main.c')
-rw-r--r-- | test/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
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(); |