mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 11:56:53 +00:00
Optimizing compatibility
This commit is contained in:
@@ -215,8 +215,10 @@ reset:
|
||||
}
|
||||
if c.RateLimit == 0 {
|
||||
c.Rate = rate.NewRate(int64(2 << 23))
|
||||
c.Rate.Start()
|
||||
} else if c.Rate == nil {
|
||||
c.Rate = rate.NewRate(int64(c.RateLimit * 1024))
|
||||
}
|
||||
c.Rate.Start()
|
||||
if !s.VerifyVkey(c.VerifyKey, c.Id) {
|
||||
if isNotSet {
|
||||
goto reset
|
||||
|
@@ -88,7 +88,7 @@ func (s *Client) GetConn() bool {
|
||||
func (s *Client) HasTunnel(t *Tunnel) (exist bool) {
|
||||
GetDb().JsonDb.Tasks.Range(func(key, value interface{}) bool {
|
||||
v := value.(*Tunnel)
|
||||
if v.Client.Id == s.Id && v.Port == t.Port {
|
||||
if v.Client.Id == s.Id && v.Port == t.Port && t.Port != 0 {
|
||||
exist = true
|
||||
return false
|
||||
}
|
||||
@@ -152,8 +152,8 @@ type Host struct {
|
||||
Location string //url router
|
||||
Remark string //remark
|
||||
Scheme string //http https all
|
||||
CertFilePath string
|
||||
KeyFilePath string
|
||||
CertFilePath string
|
||||
KeyFilePath string
|
||||
NoStore bool
|
||||
IsClose bool
|
||||
Flow *Flow
|
||||
|
Reference in New Issue
Block a user