More resolved TODOs
This commit is contained in:
parent
3a56fb9db8
commit
07e3705f09
4 changed files with 26 additions and 15 deletions
10
share/cfg.go
10
share/cfg.go
|
|
@ -7,12 +7,6 @@ import (
|
|||
"log/slog"
|
||||
)
|
||||
|
||||
var defaultListenIP = net.ParseIP("127.0.0.1")
|
||||
|
||||
func GetDefaultListenIPStr() string {
|
||||
return defaultListenIP.String()
|
||||
}
|
||||
|
||||
type UserConfiguration struct {
|
||||
listenIP net.IP
|
||||
ftpExtIP net.IP
|
||||
|
|
@ -49,6 +43,10 @@ func (rc RawUserConfiguration) Process(backend string, warnLogger *slog.Logger)
|
|||
}
|
||||
}
|
||||
|
||||
if rc.SMBExtMode && backend != "smb" && !IsSMBExtModeDefault() {
|
||||
slog.Warn("SMB external mode specification is ineffective with non-SMB backends")
|
||||
}
|
||||
|
||||
return &UserConfiguration{
|
||||
listenIP: listenIP,
|
||||
ftpExtIP: ftpExtIP,
|
||||
|
|
|
|||
16
share/defaults.go
Normal file
16
share/defaults.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package share
|
||||
|
||||
import (
|
||||
"net"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func IsSMBExtModeDefault() bool {
|
||||
return runtime.GOOS == "windows1"
|
||||
}
|
||||
|
||||
var defaultListenIP = net.ParseIP("127.0.0.1")
|
||||
|
||||
func GetDefaultListenIPStr() string {
|
||||
return defaultListenIP.String()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue