From e6a1bede89403920a9875f43e6981ed46dd2ab05 Mon Sep 17 00:00:00 2001 From: gotjosh Date: Fri, 5 Feb 2021 17:06:47 +0000 Subject: [PATCH] Make MaxGossipPacketSize public (#2475) Downstream implementations might want to configure it. Signed-off-by: gotjosh --- cluster/channel.go | 2 +- cluster/cluster.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cluster/channel.go b/cluster/channel.go index aba87b64..41a1742d 100644 --- a/cluster/channel.go +++ b/cluster/channel.go @@ -145,5 +145,5 @@ func (c *Channel) Broadcast(b []byte) { // OversizedMessage indicates whether or not the byte payload should be sent // via TCP. func OversizedMessage(b []byte) bool { - return len(b) > maxGossipPacketSize/2 + return len(b) > MaxGossipPacketSize/2 } diff --git a/cluster/cluster.go b/cluster/cluster.go index d7a513d2..848c7bb6 100644 --- a/cluster/cluster.go +++ b/cluster/cluster.go @@ -103,7 +103,7 @@ const ( DefaultReconnectInterval = 10 * time.Second DefaultReconnectTimeout = 6 * time.Hour DefaultRefreshInterval = 15 * time.Second - maxGossipPacketSize = 1400 + MaxGossipPacketSize = 1400 ) func Create( @@ -202,7 +202,7 @@ func Create( cfg.ProbeInterval = probeInterval cfg.LogOutput = &logWriter{l: l} cfg.GossipNodes = retransmit - cfg.UDPBufferSize = maxGossipPacketSize + cfg.UDPBufferSize = MaxGossipPacketSize if advertiseHost != "" { cfg.AdvertiseAddr = advertiseHost