From 1bad176f8d6be0bf8890b5efeaae0d1b4bdb1281 Mon Sep 17 00:00:00 2001 From: Saverio Proto Date: Sat, 7 Jun 2014 13:49:58 +0200 Subject: [PATCH] open listening sockets at meshlink_start() and not at meshlink_open() --- src/meshlink.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/meshlink.c b/src/meshlink.c index 7ea3e440..b57eb21b 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -773,11 +773,6 @@ meshlink_handle_t *meshlink_open(const char *confbase, const char *name) { WSAStartup(MAKEWORD(2, 2), &wsa_state); #endif - // Setup up everything - // TODO: we should not open listening sockets yet - - if(!setup_network(mesh)) - return meshlink_close(mesh), NULL; return mesh; } @@ -800,6 +795,10 @@ bool meshlink_start(meshlink_handle_t *mesh) { fprintf(stderr, "No name given!\n"); return false; } + // Setup up everything + + if(!setup_network(mesh)) + return meshlink_close(mesh), NULL; // Start the main thread -- 2.39.2