]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.c
Invitation protocol: correctly initialize and reset mesh->thedatalen after join is...
[meshlink] / src / meshlink.c
index 30d71a2bef709136edf1cff2a296fd6a01f117f9..956651155fbe09bffde83dd0ddde1ef47c0aa229 100644 (file)
@@ -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