summaryrefslogtreecommitdiffstats
path: root/src/resolve.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-07-24 13:54:35 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-07-24 13:54:35 +0200
commit01196a23874f5e826b0fd3641aac6b85ede32fa5 (patch)
treeedd2c24cbddbe56a0b3a0d3beea01abe6256fac6 /src/resolve.c
parent0b8d807bf675189fd496b6313283d58f917368d9 (diff)
downloadfastd-01196a23874f5e826b0fd3641aac6b85ede32fa5.tar
fastd-01196a23874f5e826b0fd3641aac6b85ede32fa5.zip
Don't let resolves delay handshakes
Diffstat (limited to 'src/resolve.c')
-rw-r--r--src/resolve.c20
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;
}