|
@@ -5,6 +5,7 @@ import (
|
|
"net"
|
|
"net"
|
|
"strings"
|
|
"strings"
|
|
"time"
|
|
"time"
|
|
|
|
+ "math"
|
|
|
|
|
|
"x-ui/util/common"
|
|
"x-ui/util/common"
|
|
)
|
|
)
|
|
@@ -78,11 +79,11 @@ func (s *AllSetting) CheckValid() error {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if s.WebPort <= 0 || s.WebPort > 65535 {
|
|
|
|
|
|
+ if s.WebPort <= 0 || s.WebPort > math.MaxUint16 {
|
|
return common.NewError("web port is not a valid port:", s.WebPort)
|
|
return common.NewError("web port is not a valid port:", s.WebPort)
|
|
}
|
|
}
|
|
|
|
|
|
- if s.SubPort <= 0 || s.SubPort > 65535 {
|
|
|
|
|
|
+ if s.SubPort <= 0 || s.SubPort > math.MaxUint16 {
|
|
return common.NewError("Sub port is not a valid port:", s.SubPort)
|
|
return common.NewError("Sub port is not a valid port:", s.SubPort)
|
|
}
|
|
}
|
|
|
|
|