diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..c3046cbd --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1 @@ +Please Move to https://github.com/v2fly/v2ray-core/pulls diff --git a/app/stats/stats.go b/app/stats/stats.go index 7bb56b28..fc9684d6 100644 --- a/app/stats/stats.go +++ b/app/stats/stats.go @@ -184,3 +184,4 @@ func (m *Manager) Start() error { func (m *Manager) Close() error { return nil } + diff --git a/features/stats/stats.go b/features/stats/stats.go index 2a0acec2..6ac0da26 100644 --- a/features/stats/stats.go +++ b/features/stats/stats.go @@ -38,6 +38,7 @@ type Manager interface { // RegisterCounter registers a new counter to the manager. The identifier string must not be empty, and unique among other counters. RegisterCounter(string) (Counter, error) + UnregisterCounter(string) error // GetCounter returns a counter by its identifier. GetCounter(string) Counter @@ -87,6 +88,11 @@ func (NoopManager) RegisterCounter(string) (Counter, error) { return nil, newError("not implemented") } +// UnregisterCounter implements Manager. +func (NoopManager) UnregisterCounter(string) error { + return newError("not implemented") +} + // GetCounter implements Manager. func (NoopManager) GetCounter(string) Counter { return nil diff --git a/proxy/http/server.go b/proxy/http/server.go index f956438c..2999a40e 100644 --- a/proxy/http/server.go +++ b/proxy/http/server.go @@ -111,7 +111,7 @@ Start: if len(s.config.Accounts) > 0 { user, pass, ok := parseBasicAuth(request.Header.Get("Proxy-Authorization")) if !ok || !s.config.HasAccount(user, pass) { - return common.Error2(conn.Write([]byte("HTTP/1.1 407 Proxy Authentication Required\r\nProxy-Authenticate: Basic realm=\"proxy\"\r\n\r\n"))) + return common.Error2(conn.Write([]byte("HTTP/1.1 407 Proxy Authentication Required\r\nProxy-Authenticate: Basic realm=\"proxy\"\r\nConnection: close\r\n\r\n"))) } if inbound != nil { inbound.User.Email = user diff --git a/proxy/vmess/validator.go b/proxy/vmess/validator.go index e308255b..0bb67854 100644 --- a/proxy/vmess/validator.go +++ b/proxy/vmess/validator.go @@ -190,13 +190,12 @@ func (v *TimedUserValidator) Remove(email string) bool { v.Lock() defer v.Unlock() - email = strings.ToLower(email) idx := -1 - for i, u := range v.users { - if strings.EqualFold(u.user.Email, email) { + for i := range v.users { + if strings.EqualFold(v.users[i].user.Email, email) { idx = i var cmdkeyfl [16]byte - copy(cmdkeyfl[:], u.user.Account.(*MemoryAccount).ID.CmdKey()) + copy(cmdkeyfl[:], v.users[i].user.Account.(*MemoryAccount).ID.CmdKey()) v.aeadDecoderHolder.RemoveUser(cmdkeyfl) break }