From 773e84403fae0da82575f04eef911a31267b167a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 5 Nov 2012 22:35:29 +0100 Subject: 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 --- src/peer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- cgit v1.2.3