From: Guus Sliepen Date: Thu, 6 Jul 2017 20:04:00 +0000 (+0200) Subject: Restart the mesh even after a failed join(). X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=bb6e35501cb2c39e52022416592c5869a2f0bf40;p=meshlink Restart the mesh even after a failed join(). --- diff --git a/examples/channels.c b/examples/channels.c index 6d34de36..1fceb0b4 100644 --- a/examples/channels.c +++ b/examples/channels.c @@ -99,12 +99,11 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) { meshlink_stop(mesh); if(!meshlink_join(mesh, arg)) fprintf(stderr, "Could not join using invitation: %s\n", meshlink_strerror(meshlink_errno)); - else { + else fprintf(stderr, "Invitation accepted!\n"); - if(!meshlink_start(mesh)) { - fprintf(stderr, "Could not start MeshLink: %s\n", meshlink_strerror(meshlink_errno)); - return; - } + if(!meshlink_start(mesh)) { + fprintf(stderr, "Could not restart MeshLink: %s\n", meshlink_strerror(meshlink_errno)); + exit(1); } } else if(!strcasecmp(buf, "kick")) { if(!arg) {