Skip to content

Commit

Permalink
fixed fatal linux error with listenaddr incorrectly duplicated
Browse files Browse the repository at this point in the history
  • Loading branch information
deranjer committed Mar 22, 2019
1 parent 496e255 commit 5b262e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions config.toml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
11 changes: 4 additions & 7 deletions settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 5b262e6

Please sign in to comment.