*port++ = 0;
}
- if(!*port)
+ if(!port)
port = "655";
if(!b64decode(slash, mesh->hash, 18) || !b64decode(slash + 24, mesh->cookie, 18))
char *b64key = ecdsa_get_base64_public_key(key);
+ //Before doing meshlink_join make sure we are not connected to another mesh
+ if ( pthread_kill(mesh->thread,0) == 0){
+ printf("HELLO\n");
+ goto invalid;
+ }
+
// Connect to the meshlink daemon mentioned in the URL.
struct addrinfo *ai = str2addrinfo(address, port, SOCK_STREAM);
if(!ai)
return true;
invalid:
- fprintf(stderr, "Invalid invitation URL.\n");
+ fprintf(stderr, "Invalid invitation URL or you are already connected to a Mesh ?\n");
return false;
}