X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=src%2Fnet.c;h=2ee8aee446bc1df899354fb1cb93c1373e7aa844;hb=8c8b506da9ce578fe6e6e406a91bbd21af13f7a3;hp=05049cffca96c87039f94b6b5b11e5d4c2b224d8;hpb=09a250a2b1d475700e1d8f18d1a835d17d0483b1;p=meshlink diff --git a/src/net.c b/src/net.c index 05049cff..2ee8aee4 100644 --- a/src/net.c +++ b/src/net.c @@ -92,13 +92,6 @@ void terminate_connection(meshlink_handle_t *mesh, connection_t *c, bool report) if(outgoing) { do_outgoing_connection(mesh, outgoing); } - -#ifndef HAVE_MINGW - /* Clean up dead proxy processes */ - - while(waitpid(-1, NULL, WNOHANG) > 0); - -#endif } /* @@ -130,6 +123,16 @@ static void timeout_handler(event_loop_t *loop, void *data) { } } + if(c->status.active && c->last_key_renewal + 3600 < mesh->loop.now.tv_sec) { + if(!sptps_force_kex(&c->sptps)) { + logger(mesh, MESHLINK_ERROR, "SPTPS key renewal for connection with %s failed", c->name); + terminate_connection(mesh, c, true); + continue; + } else { + c->last_key_renewal = mesh->loop.now.tv_sec; + } + } + if(c->last_ping_time + pingtimeout <= mesh->loop.now.tv_sec) { if(c->status.active) { if(c->status.pinged) {