]> git.meshlink.io Git - meshlink/commitdiff
Invitation protocol: correctly initialize and reset mesh->thedatalen after join is...
authorSaverio Proto <zioproto@gmail.com>
Sun, 17 Aug 2014 11:01:37 +0000 (13:01 +0200)
committerSaverio Proto <zioproto@gmail.com>
Sun, 17 Aug 2014 11:30:08 +0000 (13:30 +0200)
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