mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
format code
This commit is contained in:
parent
4c963a51ed
commit
54fe1ed8b1
@ -57,7 +57,7 @@ func ReadAuthentication(reader io.Reader) (auth Socks5AuthenticationRequest, err
|
||||
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)
|
||||
return
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func TestVMessSerialization(t *testing.T) {
|
||||
t.Skip();
|
||||
t.Skip()
|
||||
assert := unit.Assert(t)
|
||||
|
||||
userId, err := core.NewID("2b2966ac-16aa-4fbf-8d81-c5f172a3da51")
|
||||
|
@ -95,7 +95,7 @@ func (server *SocksServer) HandleConnection(connection net.Conn) error {
|
||||
return err
|
||||
}
|
||||
status := byte(0)
|
||||
if ! upRequest.IsValid(server.config.Username, server.config.Password) {
|
||||
if !upRequest.IsValid(server.config.Username, server.config.Password) {
|
||||
status = byte(0xFF)
|
||||
}
|
||||
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 {
|
||||
idHash := id.TimeHash(lastSec)
|
||||
hash2Remove <- hashEntry{string(idHash), lastSec}
|
||||
us.userHashes[string(idHash)] = indexTimePair{idx, lastSec}
|
||||
}
|
||||
lastSec ++
|
||||
lastSec++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user