Просмотр исходного кода

fixed add new user bug

fixed add new user bug.
when add new user, just add the key(u.email) to the map(v.cache), the value of map is nil.
hex2tan 6 лет назад
Родитель
Сommit
3d63ec4e78
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      proxy/vmess/inbound/inbound.go

+ 2 - 2
proxy/vmess/inbound/inbound.go

@@ -47,11 +47,11 @@ func newUserByEmail(config *DefaultConfig) *userByEmail {
 
 
 func (v *userByEmail) addNoLock(u *protocol.MemoryUser) bool {
 func (v *userByEmail) addNoLock(u *protocol.MemoryUser) bool {
 	email := strings.ToLower(u.Email)
 	email := strings.ToLower(u.Email)
-	user, found := v.cache[email]
+	_, found := v.cache[email]
 	if found {
 	if found {
 		return false
 		return false
 	}
 	}
-	v.cache[email] = user
+	v.cache[email] = u
 	return true
 	return true
 }
 }