1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-29 12:47:26 -05:00

Merge pull request #258 from Loyalsoldier/refine-codes

Refine codes
This commit is contained in:
Loyalsoldier 2020-10-04 06:31:42 +08:00 committed by GitHub
commit 68dd2a0d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -39,7 +39,7 @@ func (s *routingServer) TestRoute(ctx context.Context, request *TestRouteRequest
return nil, err return nil, err
} }
if request.PublishResult && s.routingStats != nil { if request.PublishResult && s.routingStats != nil {
ctx, _ := context.WithTimeout(context.Background(), 4*time.Second) // nolint: lostcancel ctx, _ := context.WithTimeout(context.Background(), 4*time.Second) // nolint: govet
s.routingStats.Publish(ctx, route) s.routingStats.Publish(ctx, route)
} }
return AsProtobufMessage(request.FieldSelectors)(route), nil return AsProtobufMessage(request.FieldSelectors)(route), nil

View File

@ -19,8 +19,8 @@ import (
// MemoryAccount is an account type converted from Account. // MemoryAccount is an account type converted from Account.
type MemoryAccount struct { type MemoryAccount struct {
Cipher Cipher Cipher Cipher
Key []byte Key []byte
} }
// Equals implements protocol.Account.Equals(). // Equals implements protocol.Account.Equals().
@ -87,8 +87,8 @@ func (a *Account) AsAccount() (protocol.Account, error) {
return nil, newError("failed to get cipher").Base(err) return nil, newError("failed to get cipher").Base(err)
} }
return &MemoryAccount{ return &MemoryAccount{
Cipher: cipher, Cipher: cipher,
Key: passwordToCipherKey([]byte(a.Password), cipher.KeySize()), Key: passwordToCipherKey([]byte(a.Password), cipher.KeySize()),
}, nil }, nil
} }

View File

@ -19,7 +19,7 @@ import (
) )
const ( const (
Version = 1 Version = 1
) )
var addrParser = protocol.NewAddressParser( var addrParser = protocol.NewAddressParser(