fixed fatal linux error with listenaddr incorrectly duplicated

This commit is contained in:
2019-03-22 16:22:48 -04:00
parent 496e255884
commit 5b262e6651
2 changed files with 6 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
[serverConfig]
ServerPort = "8000" #leave format as is it expects a string with colon
ServerAddr = "192.168.1.8" #Put in the IP address you want to bind to
ServerPort = "8000" #Required to input as string
ServerAddr = "192.168.1.8" #Put in the IP address you want to bind to as string
LogLevel = "Debug" # Options = Debug, Info, Warn, Error, Fatal, Panic
LogOutput = "file" #Options = file, stdout #file will print it to logs/server.log

View File

@@ -217,12 +217,12 @@ func FullClientSettingsNew() FullClientSettings {
// fmt.Println("Reading in custom DHT config")
// dhtServerConfig = dhtServerSettings(dhtServerConfig)
//}
strippedHTTPPort := strings.TrimPrefix(httpAddrPort, ":")
httpAddrPortInt64, err := strconv.ParseInt(strippedHTTPPort, 10, 0)
strippedDHTPort := strings.TrimPrefix(listenAddr, ":")
DHTPortInt64, err := strconv.ParseInt(strippedDHTPort, 10, 0)
if err != nil {
fmt.Println("Failed creating 64-bit integer for goTorrent Port!", err)
}
httpAddrPortInt := int(httpAddrPortInt64) //converting to integer
DHTPortInt := int(DHTPortInt64) //converting to integer
encryptionPolicy := torrent.EncryptionPolicy{
DisableEncryption: viper.GetBool("EncryptionPolicy.DisableEncryption"),
@@ -233,7 +233,7 @@ func FullClientSettingsNew() FullClientSettings {
tConfig := torrent.NewDefaultClientConfig()
tConfig.DataDir = dataDirAbs
tConfig.ListenPort = httpAddrPortInt
tConfig.ListenPort = DHTPortInt
tConfig.DisablePEX = disablePex
tConfig.NoDHT = noDHT
tConfig.NoUpload = noUpload
@@ -246,9 +246,6 @@ func FullClientSettingsNew() FullClientSettings {
tConfig.DisableIPv6 = disableIPv6
tConfig.Debug = debug
tConfig.EncryptionPolicy = encryptionPolicy
if listenAddr != "" {
tConfig.SetListenAddr(listenAddr) //Setting the IP address to listen on
}
Config := FullClientSettings{
LoggingLevel: logLevel,