diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-07-24 13:54:35 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-07-24 13:54:35 +0200 |
commit | 01196a23874f5e826b0fd3641aac6b85ede32fa5 (patch) | |
tree | edd2c24cbddbe56a0b3a0d3beea01abe6256fac6 /src/resolve.c | |
parent | 0b8d807bf675189fd496b6313283d58f917368d9 (diff) | |
download | fastd-01196a23874f5e826b0fd3641aac6b85ede32fa5.tar fastd-01196a23874f5e826b0fd3641aac6b85ede32fa5.zip |
Don't let resolves delay handshakes
Diffstat (limited to 'src/resolve.c')
-rw-r--r-- | src/resolve.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/resolve.c b/src/resolve.c index 062eb91..103ba5f 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -109,25 +109,7 @@ void fastd_resolve_peer(fastd_context_t *ctx, fastd_peer_t *peer) { } if (timespec_diff(&ctx->now, &peer->last_resolve) < ctx->conf->min_resolve_interval*1000) { - pr_debug(ctx, "not resolving %P as it has been resolved a short time ago", peer); - - size_t hostname_len = strlen(peer->config->hostname); - char buf[sizeof(fastd_resolve_return_t) + hostname_len]; - - fastd_resolve_return_t *ret = (void*)buf; - char *hostname = buf + sizeof(fastd_resolve_return_t); - - memset(ret, 0, sizeof(fastd_resolve_return_t)); - - ret->constraints = peer->config->address; - ret->hostname_len = hostname_len; - memcpy(hostname, peer->config->hostname, hostname_len); - - ret->addr = peer->address; - - if (write(ctx->resolvewfd, buf, sizeof(buf)) < 0) - pr_error_errno(ctx, "can't write resolve return"); - + /* last resolve was just a few seconds ago */ return; } |