summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-11-05 22:35:29 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-11-05 22:35:29 +0100
commit773e84403fae0da82575f04eef911a31267b167a (patch)
tree96604e7e1bb0371a236b0d2689e64d96240268f7
parent8f60a96b84b1f952b0f3073e5df52f024162ef4b (diff)
downloadfastd-773e84403fae0da82575f04eef911a31267b167a.tar
fastd-773e84403fae0da82575f04eef911a31267b167a.zip
Add randomized initial handshake delays
This delay should barely be noticable, and it will make fastd connect to a random choice of peers when a peer limit is set
-rw-r--r--src/peer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/peer.c b/src/peer.c
index a735f5e..86cf4a1 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -228,7 +228,7 @@ static void setup_peer(fastd_context *ctx, fastd_peer *peer) {
ctx->conf->protocol->init_peer_state(ctx, peer);
if (!fastd_peer_is_floating(peer) || fastd_peer_is_dynamic(peer))
- fastd_task_schedule_handshake(ctx, peer, 0);
+ fastd_task_schedule_handshake(ctx, peer, fastd_rand(ctx, 0, 3000));
}
static void delete_peer(fastd_context *ctx, fastd_peer *peer) {