Skip to content

Commit ca52d04

Browse files
committed
use default max int
Signed-off-by: mudler <[email protected]>
1 parent 5860284 commit ca52d04

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pkg/config/config.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ import (
4242
"github.com/peterbourgon/diskv"
4343
)
4444

45+
const MaxUint = ^uint(0)
46+
const MinUint = 0
47+
const MaxInt = int(MaxUint >> 1)
48+
const MinInt = -MaxInt - 1
49+
4550
// Config is the config struct for the node and the default EdgeVPN services
4651
// It is used to generate opts for the node and the services before start.
4752
type Config struct {
@@ -272,6 +277,8 @@ func (c Config) ToOpts(l *logger.Logger) ([]node.Option, []vpn.Option, error) {
272277
}
273278

274279
if c.Connection.LowWater != 0 && c.Connection.HighWater != 0 {
280+
llger.Infof("connmanager water limits low: %d high: %d", c.Connection.LowWater, c.Connection.HighWater)
281+
275282
cm, err := connmanager.NewConnManager(
276283
c.Connection.LowWater,
277284
c.Connection.HighWater,
@@ -283,9 +290,10 @@ func (c Config) ToOpts(l *logger.Logger) ([]node.Option, []vpn.Option, error) {
283290

284291
libp2pOpts = append(libp2pOpts, libp2p.ConnectionManager(cm))
285292
} else {
293+
llger.Infof("connmanager low-hi connections: %d", MaxInt)
286294
cm, err := connmanager.NewConnManager(
287-
9999999999,
288-
9999999999,
295+
MaxInt,
296+
MaxInt,
289297
connmanager.WithGracePeriod(80*time.Second),
290298
)
291299
if err != nil {

0 commit comments

Comments
 (0)