Darien Raymond 7 роки тому
батько
коміт
67f5292f38

+ 1 - 0
app/log/command/command.go

@@ -16,6 +16,7 @@ type LoggerServer struct {
 	V *core.Instance
 }
 
+// RestartLogger implements LoggerService.
 func (s *LoggerServer) RestartLogger(ctx context.Context, request *RestartLoggerRequest) (*RestartLoggerResponse, error) {
 	logger := s.V.GetFeature((*log.Instance)(nil))
 	if logger == nil {

+ 2 - 2
app/log/log.go

@@ -138,10 +138,10 @@ func (g *Instance) Close() error {
 
 	g.active = false
 
-	common.Close(g.accessLogger)
+	common.Ignore(common.Close(g.accessLogger), "Recycling it anyway")
 	g.accessLogger = nil
 
-	common.Close(g.errorLogger)
+	common.Ignore(common.Close(g.errorLogger), "Recycling this too")
 	g.errorLogger = nil
 
 	return nil

+ 0 - 7
app/proxyman/errors.generated.go

@@ -1,7 +0,0 @@
-package proxyman
-
-import "v2ray.com/core/common/errors"
-
-func newError(values ...interface{}) *errors.Error {
-	return errors.New(values...).Path("App", "Proxyman")
-}

+ 0 - 2
app/proxyman/proxyman.go

@@ -1,8 +1,6 @@
 // Package proxyman defines applications for managing inbound and outbound proxies.
 package proxyman
 
-//go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg proxyman -path App,Proxyman
-
 import (
 	"context"
 )

+ 2 - 0
app/stats/stats.go

@@ -74,10 +74,12 @@ func (m *Manager) GetCounter(name string) core.StatCounter {
 	return nil
 }
 
+// Start implements common.Runnable.
 func (m *Manager) Start() error {
 	return nil
 }
 
+// Close implement common.Closable.
 func (m *Manager) Close() error {
 	return nil
 }

+ 1 - 0
common/errors/errors.go

@@ -63,6 +63,7 @@ func (v *Error) WithContext(ctx context.Context) *Error {
 	return v
 }
 
+// Context returns the context that associated with the Error.
 func (v *Error) Context() context.Context {
 	if v.ctx != nil {
 		return v.ctx

+ 0 - 2
main/confloader/confloader.go

@@ -5,8 +5,6 @@ import (
 	"os"
 )
 
-//go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg confloader -path Main,ConfLoader
-
 type configFileLoader func(string) (io.ReadCloser, error)
 
 var (

+ 0 - 7
main/confloader/errors.generated.go

@@ -1,7 +0,0 @@
-package confloader
-
-import "v2ray.com/core/common/errors"
-
-func newError(values ...interface{}) *errors.Error {
-	return errors.New(values...).Path("Main", "ConfLoader")
-}

+ 1 - 0
proxy/vmess/outbound/outbound.go

@@ -29,6 +29,7 @@ type Handler struct {
 	v            *core.Instance
 }
 
+// New creates a new VMess outbound handler.
 func New(ctx context.Context, config *Config) (*Handler, error) {
 	serverList := protocol.NewServerList()
 	for _, rec := range config.Receiver {

+ 1 - 1
proxy/vmess/vmess.go

@@ -56,7 +56,7 @@ func NewTimedUserValidator(hasher protocol.IDHash) *TimedUserValidator {
 			return nil
 		},
 	}
-	tuv.task.Start()
+	common.Must(tuv.task.Start())
 	return tuv
 }
 

+ 1 - 1
transport/internet/headers/tls/dtls.go

@@ -10,8 +10,8 @@ import (
 // DTLS writes header as DTLS. See https://tools.ietf.org/html/rfc6347
 type DTLS struct {
 	epoch    uint16
-	sequence uint32
 	length   uint16
+	sequence uint32
 }
 
 // Size implements PacketHeader.

+ 1 - 0
transport/pipe/pipe.go

@@ -7,6 +7,7 @@ import (
 	"v2ray.com/core/common/signal"
 )
 
+// Option for creating new Pipes.
 type Option func(*pipe)
 
 func WithoutSizeLimit() Option {