mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 07:26:24 -05:00
gofmt
This commit is contained in:
parent
1e6d5561cc
commit
3a0f211c22
@ -2,4 +2,6 @@ package commander
|
|||||||
|
|
||||||
import "v2ray.com/core/common/errors"
|
import "v2ray.com/core/common/errors"
|
||||||
|
|
||||||
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("App", "Commander") }
|
func newError(values ...interface{}) *errors.Error {
|
||||||
|
return errors.New(values...).Path("App", "Commander")
|
||||||
|
}
|
||||||
|
@ -62,4 +62,4 @@ func (co *CommanderOutbound) Start() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (co *CommanderOutbound) Close() {}
|
func (co *CommanderOutbound) Close() {}
|
||||||
|
@ -2,4 +2,6 @@ package command
|
|||||||
|
|
||||||
import "v2ray.com/core/common/errors"
|
import "v2ray.com/core/common/errors"
|
||||||
|
|
||||||
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("App", "Proxyman", "Command") }
|
func newError(values ...interface{}) *errors.Error {
|
||||||
|
return errors.New(values...).Path("App", "Proxyman", "Command")
|
||||||
|
}
|
||||||
|
@ -53,4 +53,4 @@ type GetInbound interface {
|
|||||||
|
|
||||||
type GetOutbound interface {
|
type GetOutbound interface {
|
||||||
GetOutbound() Outbound
|
GetOutbound() Outbound
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,9 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type idEntry struct {
|
type idEntry struct {
|
||||||
id *protocol.ID
|
id *protocol.ID
|
||||||
userIdx int
|
userIdx int
|
||||||
lastSec protocol.Timestamp
|
lastSec protocol.Timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
type TimedUserValidator struct {
|
type TimedUserValidator struct {
|
||||||
@ -114,17 +114,17 @@ func (v *TimedUserValidator) Add(user *protocol.User) error {
|
|||||||
nowSec := time.Now().Unix()
|
nowSec := time.Now().Unix()
|
||||||
|
|
||||||
entry := &idEntry{
|
entry := &idEntry{
|
||||||
id: account.ID,
|
id: account.ID,
|
||||||
userIdx: idx,
|
userIdx: idx,
|
||||||
lastSec: protocol.Timestamp(nowSec - cacheDurationSec),
|
lastSec: protocol.Timestamp(nowSec - cacheDurationSec),
|
||||||
}
|
}
|
||||||
v.generateNewHashes(protocol.Timestamp(nowSec+cacheDurationSec), idx, entry)
|
v.generateNewHashes(protocol.Timestamp(nowSec+cacheDurationSec), idx, entry)
|
||||||
v.ids = append(v.ids, entry)
|
v.ids = append(v.ids, entry)
|
||||||
for _, alterid := range account.AlterIDs {
|
for _, alterid := range account.AlterIDs {
|
||||||
entry := &idEntry{
|
entry := &idEntry{
|
||||||
id: alterid,
|
id: alterid,
|
||||||
userIdx: idx,
|
userIdx: idx,
|
||||||
lastSec: protocol.Timestamp(nowSec - cacheDurationSec),
|
lastSec: protocol.Timestamp(nowSec - cacheDurationSec),
|
||||||
}
|
}
|
||||||
v.generateNewHashes(protocol.Timestamp(nowSec+cacheDurationSec), idx, entry)
|
v.generateNewHashes(protocol.Timestamp(nowSec+cacheDurationSec), idx, entry)
|
||||||
v.ids = append(v.ids, entry)
|
v.ids = append(v.ids, entry)
|
||||||
|
@ -364,7 +364,7 @@ func (w *SendingWorker) CloseWrite() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *SendingWorker) IsEmpty() bool {
|
func (w *SendingWorker) IsEmpty() bool {
|
||||||
w.RLock()
|
w.RLock()
|
||||||
defer w.RUnlock()
|
defer w.RUnlock()
|
||||||
|
|
||||||
return w.window.IsEmpty()
|
return w.window.IsEmpty()
|
||||||
|
Loading…
Reference in New Issue
Block a user