From: Saverio Proto Date: Sun, 17 Aug 2014 11:01:37 +0000 (+0200) Subject: Invitation protocol: correctly initialize and reset mesh->thedatalen after join is... X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=103be3a74f3b08ec7f5d06d2c7453496b42ae6c1;p=meshlink Invitation protocol: correctly initialize and reset mesh->thedatalen after join is finished --- diff --git a/src/meshlink.c b/src/meshlink.c index 30d71a2b..95665115 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -556,6 +556,7 @@ static bool invitation_receive(void *handle, uint8_t type, const void *msg, uint break; case 1: + mesh->thedatalen = 0; return finalize_join(mesh); case 2: @@ -874,6 +875,8 @@ bool meshlink_start(meshlink_handle_t *mesh) { logger(mesh, MESHLINK_DEBUG, "meshlink_start called\n"); + mesh->thedatalen = 0; + // TODO: open listening sockets first //Check that a valid name is set