mirror of https://github.com/v2ray/v2ray-core
format code
parent
4c963a51ed
commit
54fe1ed8b1
|
@ -57,7 +57,7 @@ func ReadAuthentication(reader io.Reader) (auth Socks5AuthenticationRequest, err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if nBytes - 2 != int(auth.nMethods) {
|
if nBytes-2 != int(auth.nMethods) {
|
||||||
err = fmt.Errorf("Unmatching number of auth methods, expecting %d, but got %d", auth.nMethods, nBytes)
|
err = fmt.Errorf("Unmatching number of auth methods, expecting %d, but got %d", auth.nMethods, nBytes)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestVMessSerialization(t *testing.T) {
|
func TestVMessSerialization(t *testing.T) {
|
||||||
t.Skip();
|
t.Skip()
|
||||||
assert := unit.Assert(t)
|
assert := unit.Assert(t)
|
||||||
|
|
||||||
userId, err := core.NewID("2b2966ac-16aa-4fbf-8d81-c5f172a3da51")
|
userId, err := core.NewID("2b2966ac-16aa-4fbf-8d81-c5f172a3da51")
|
||||||
|
|
|
@ -95,7 +95,7 @@ func (server *SocksServer) HandleConnection(connection net.Conn) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
status := byte(0)
|
status := byte(0)
|
||||||
if ! upRequest.IsValid(server.config.Username, server.config.Password) {
|
if !upRequest.IsValid(server.config.Username, server.config.Password) {
|
||||||
status = byte(0xFF)
|
status = byte(0xFF)
|
||||||
}
|
}
|
||||||
upResponse := socksio.NewSocks5UserPassResponse(status)
|
upResponse := socksio.NewSocks5UserPassResponse(status)
|
||||||
|
|
|
@ -57,13 +57,13 @@ func (us *TimedUserSet) updateUserHash(tick <-chan time.Time) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for lastSec < nowSec + cacheDurationSec {
|
for lastSec < nowSec+cacheDurationSec {
|
||||||
for idx, id := range us.validUserIds {
|
for idx, id := range us.validUserIds {
|
||||||
idHash := id.TimeHash(lastSec)
|
idHash := id.TimeHash(lastSec)
|
||||||
hash2Remove <- hashEntry{string(idHash), lastSec}
|
hash2Remove <- hashEntry{string(idHash), lastSec}
|
||||||
us.userHashes[string(idHash)] = indexTimePair{idx, lastSec}
|
us.userHashes[string(idHash)] = indexTimePair{idx, lastSec}
|
||||||
}
|
}
|
||||||
lastSec ++
|
lastSec++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue