X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnet.c;h=6fd90e194442e9e96298825fa28083bf6cb444be;hb=91169c529883e08d7a0245b709483a22a83245ad;hp=0aa20439a87de39d518cb130d7c7d4852be27d9f;hpb=5d583af29b3ba76f9acaeb77c0e0457268776dcb;p=meshlink diff --git a/src/net.c b/src/net.c index 0aa20439..6fd90e19 100644 --- a/src/net.c +++ b/src/net.c @@ -354,7 +354,7 @@ static void periodic_handler(event_loop_t *loop, void *data) { if(mesh->contradicting_del_edge > 100 && mesh->contradicting_add_edge > 100) { logger(mesh, MESHLINK_WARNING, "Possible node with same Name as us! Sleeping %d seconds.", mesh->sleeptime); struct timespec ts = {mesh->sleeptime, 0}; - clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, NULL); + nanosleep(&ts, NULL); mesh->sleeptime *= 2; if(mesh->sleeptime < 0) { @@ -632,7 +632,7 @@ static void periodic_handler(event_loop_t *loop, void *data) { n->status.validkey = false; sptps_stop(&n->sptps); n->status.waitingforkey = false; - n->last_req_key = 0; + n->last_req_key = -3600; } else { n->last_req_key = mesh->loop.now.tv_sec; } @@ -671,7 +671,7 @@ void retry(meshlink_handle_t *mesh) { } if(!c->status.pinged) { - c->last_ping_time = 0; + c->last_ping_time = -3600; } sockaddr_t sa;