From: Guus Sliepen Date: Sun, 11 May 2014 22:05:47 +0000 (+0200) Subject: Don't change the port in finalize_join(). X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=0b07d0ad19634f8c28c852d64d1b22bab49924c4 Don't change the port in finalize_join(). We already have a working port thanks to meshlink_open(). --- diff --git a/src/meshlink.c b/src/meshlink.c index ce69e86d..56a1ae7a 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -558,14 +558,15 @@ static bool finalize_join(meshlink_handle_t *mesh) { fclose(f); fprintf(fh, "ECDSAPublicKey = %s\n", b64key); + fprintf(fh, "Port = %s\n", mesh->myport); + + fclose(fh); sptps_send_record(&(mesh->sptps), 1, b64key, strlen(b64key)); free(b64key); ecdsa_free(key); - check_port(mesh); - fprintf(stderr, "Configuration stored in: %s\n", mesh->confbase); return true; @@ -1141,7 +1142,7 @@ bool meshlink_join(meshlink_handle_t *mesh, const char *invitation) { *port++ = 0; } - if(!mesh->myport || !*port) + if(!*port) port = "655"; if(!b64decode(slash, mesh->hash, 18) || !b64decode(slash + 24, mesh->cookie, 18))