]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.c
Add meshlink_set_invitation_timeout().
[meshlink] / src / meshlink.c
index f6121a1ea67f589335f271a7b3edd39568ca8435..52a4389a9311e1e872091e9cccc335db94ca3b37 100644 (file)
@@ -1033,6 +1033,7 @@ meshlink_handle_t *meshlink_open(const char *confbase, const char *name, const c
        mesh->appname = xstrdup(appname);
        mesh->devclass = devclass;
        mesh->discovery = true;
+       mesh->invitation_timeout = 604800; // 1 week
 
        if(usingname) {
                mesh->name = xstrdup(name);
@@ -1744,7 +1745,7 @@ bool meshlink_set_canonical_address(meshlink_handle_t *mesh, meshlink_node_t *no
 }
 
 bool meshlink_add_address(meshlink_handle_t *mesh, const char *address) {
-       return meshlink_set_canonical_address(mesh, mesh->self, address, NULL);
+       return meshlink_set_canonical_address(mesh, (meshlink_node_t *)mesh->self, address, NULL);
 }
 
 bool meshlink_add_external_address(meshlink_handle_t *mesh) {
@@ -1832,6 +1833,10 @@ done:
        return rval;
 }
 
+void meshlink_set_invitation_timeout(meshlink_handle_t *mesh, int timeout) {
+       mesh->invitation_timeout = timeout;
+}
+
 char *meshlink_invite(meshlink_handle_t *mesh, const char *name) {
        if(!mesh) {
                meshlink_errno = MESHLINK_EINVAL;