@@ -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 {
@@ -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
@@ -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")
-}
@@ -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"
)
@@ -74,10 +74,12 @@ func (m *Manager) GetCounter(name string) core.StatCounter {
+// Start implements common.Runnable.
func (m *Manager) Start() error {
+// Close implement common.Closable.
func (m *Manager) Close() error {
@@ -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
@@ -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 (
-package confloader
- return errors.New(values...).Path("Main", "ConfLoader")
@@ -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 {
@@ -56,7 +56,7 @@ func NewTimedUserValidator(hasher protocol.IDHash) *TimedUserValidator {
},
- tuv.task.Start()
+ common.Must(tuv.task.Start())
return tuv
@@ -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.
@@ -7,6 +7,7 @@ import (
"v2ray.com/core/common/signal"
+// Option for creating new Pipes.
type Option func(*pipe)
func WithoutSizeLimit() Option {