mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-30 16:29:57 +00:00
chore: change all <= to < in config checks
This commit is contained in:
parent
4b2fd55060
commit
57590900ac
@ -131,7 +131,7 @@ func (r *Relay) Check() error {
|
|||||||
if len(r.Remote) == 0 {
|
if len(r.Remote) == 0 {
|
||||||
return errors.New("no relay remote address")
|
return errors.New("no relay remote address")
|
||||||
}
|
}
|
||||||
if r.Timeout != 0 && r.Timeout <= 4 {
|
if r.Timeout != 0 && r.Timeout < 4 {
|
||||||
return errors.New("invalid relay timeout")
|
return errors.New("invalid relay timeout")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -236,16 +236,16 @@ func (c *clientConfig) Check() error {
|
|||||||
len(c.TCPRedirect.Listen) == 0 {
|
len(c.TCPRedirect.Listen) == 0 {
|
||||||
return errors.New("please enable at least one mode")
|
return errors.New("please enable at least one mode")
|
||||||
}
|
}
|
||||||
if c.Connectivity.HandshakeIdleTimeout != 0 && c.Connectivity.HandshakeIdleTimeout <= 2 {
|
if c.Connectivity.HandshakeIdleTimeout != 0 && c.Connectivity.HandshakeIdleTimeout < 2 {
|
||||||
return errors.New("invalid handshake idle timeout")
|
return errors.New("invalid handshake idle timeout")
|
||||||
}
|
}
|
||||||
if c.Connectivity.MaxIdleTimeout != 0 && c.Connectivity.MaxIdleTimeout <= 4 {
|
if c.Connectivity.MaxIdleTimeout != 0 && c.Connectivity.MaxIdleTimeout < 4 {
|
||||||
return errors.New("invalid max idle timeout")
|
return errors.New("invalid max idle timeout")
|
||||||
}
|
}
|
||||||
if c.SOCKS5.Timeout != 0 && c.SOCKS5.Timeout <= 4 {
|
if c.SOCKS5.Timeout != 0 && c.SOCKS5.Timeout < 4 {
|
||||||
return errors.New("invalid SOCKS5 timeout")
|
return errors.New("invalid SOCKS5 timeout")
|
||||||
}
|
}
|
||||||
if c.HTTP.Timeout != 0 && c.HTTP.Timeout <= 4 {
|
if c.HTTP.Timeout != 0 && c.HTTP.Timeout < 4 {
|
||||||
return errors.New("invalid HTTP timeout")
|
return errors.New("invalid HTTP timeout")
|
||||||
}
|
}
|
||||||
if c.TUN.Timeout != 0 && c.TUN.Timeout < 4 {
|
if c.TUN.Timeout != 0 && c.TUN.Timeout < 4 {
|
||||||
@ -257,10 +257,10 @@ func (c *clientConfig) Check() error {
|
|||||||
if len(c.UDPRelay.Listen) > 0 && len(c.UDPRelay.Remote) == 0 {
|
if len(c.UDPRelay.Listen) > 0 && len(c.UDPRelay.Remote) == 0 {
|
||||||
return errors.New("no UDP relay remote address")
|
return errors.New("no UDP relay remote address")
|
||||||
}
|
}
|
||||||
if c.TCPRelay.Timeout != 0 && c.TCPRelay.Timeout <= 4 {
|
if c.TCPRelay.Timeout != 0 && c.TCPRelay.Timeout < 4 {
|
||||||
return errors.New("invalid TCP relay timeout")
|
return errors.New("invalid TCP relay timeout")
|
||||||
}
|
}
|
||||||
if c.UDPRelay.Timeout != 0 && c.UDPRelay.Timeout <= 4 {
|
if c.UDPRelay.Timeout != 0 && c.UDPRelay.Timeout < 4 {
|
||||||
return errors.New("invalid UDP relay timeout")
|
return errors.New("invalid UDP relay timeout")
|
||||||
}
|
}
|
||||||
for _, r := range c.TCPRelays {
|
for _, r := range c.TCPRelays {
|
||||||
@ -273,13 +273,13 @@ func (c *clientConfig) Check() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if c.TCPTProxy.Timeout != 0 && c.TCPTProxy.Timeout <= 4 {
|
if c.TCPTProxy.Timeout != 0 && c.TCPTProxy.Timeout < 4 {
|
||||||
return errors.New("invalid TCP TProxy timeout")
|
return errors.New("invalid TCP TProxy timeout")
|
||||||
}
|
}
|
||||||
if c.UDPTProxy.Timeout != 0 && c.UDPTProxy.Timeout <= 4 {
|
if c.UDPTProxy.Timeout != 0 && c.UDPTProxy.Timeout < 4 {
|
||||||
return errors.New("invalid UDP TProxy timeout")
|
return errors.New("invalid UDP TProxy timeout")
|
||||||
}
|
}
|
||||||
if c.TCPRedirect.Timeout != 0 && c.TCPRedirect.Timeout <= 4 {
|
if c.TCPRedirect.Timeout != 0 && c.TCPRedirect.Timeout < 4 {
|
||||||
return errors.New("invalid TCP Redirect timeout")
|
return errors.New("invalid TCP Redirect timeout")
|
||||||
}
|
}
|
||||||
if len(c.Server) == 0 {
|
if len(c.Server) == 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user