Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #104 from libp2p/remove-deprecated-ipfs-reuseport
Browse files Browse the repository at this point in the history
remove the deprecated IPFS_REUSEPORT command line flag
  • Loading branch information
marten-seemann committed Sep 29, 2021
2 parents 21ea663 + 4bf42ec commit c0bf21d
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions reuseport.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
// envReuseport is the env variable name used to turn off reuse port.
// It default to true.
const envReuseport = "LIBP2P_TCP_REUSEPORT"
const deprecatedEnvReuseport = "IPFS_REUSEPORT"

// envReuseportVal stores the value of envReuseport. defaults to true.
var envReuseportVal = true
Expand All @@ -21,17 +20,9 @@ func init() {
envReuseportVal = false
log.Infof("REUSEPORT disabled (LIBP2P_TCP_REUSEPORT=%s)", v)
}
v, exist := os.LookupEnv(deprecatedEnvReuseport)
if exist {
log.Warn("IPFS_REUSEPORT is deprecated, use LIBP2P_TCP_REUSEPORT instead")
if v == "false" || v == "f" || v == "0" {
envReuseportVal = false
log.Infof("REUSEPORT disabled (IPFS_REUSEPORT=%s)", v)
}
}
}

// reuseportIsAvailable returns whether reuseport is available to be used. This
// ReuseportIsAvailable returns whether reuseport is available to be used. This
// is here because we want to be able to turn reuseport on and off selectively.
// For now we use an ENV variable, as this handles our pressing need:
//
Expand Down

0 comments on commit c0bf21d

Please sign in to comment.