From 855925a8052cf470de099f252da6492b69100236 Mon Sep 17 00:00:00 2001 From: Jinqiu Yu Date: Thu, 15 Mar 2018 10:32:10 +0800 Subject: [PATCH] Fix typo --- app/commander/outbound.go | 2 +- app/dispatcher/default.go | 4 ++-- app/proxyman/command/command.go | 2 +- app/proxyman/proxyman.go | 2 +- common/signal/done.go | 2 +- common/signal/exec.go | 2 +- common/signal/notifier.go | 2 +- v2ray.go | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/commander/outbound.go b/app/commander/outbound.go index 19b90010..f82ae6f2 100644 --- a/app/commander/outbound.go +++ b/app/commander/outbound.go @@ -27,7 +27,7 @@ func (l *OutboundListener) add(conn net.Conn) { func (l *OutboundListener) Accept() (net.Conn, error) { select { case <-l.done.C(): - return nil, newError("listern closed") + return nil, newError("listen closed") case c := <-l.buffer: return c, nil } diff --git a/app/dispatcher/default.go b/app/dispatcher/default.go index 738fbb53..50f39741 100644 --- a/app/dispatcher/default.go +++ b/app/dispatcher/default.go @@ -55,7 +55,7 @@ func (d *DefaultDispatcher) Dispatch(ctx context.Context, destination net.Destin ctx = proxy.ContextWithTarget(ctx, destination) outbound := ray.NewRay(ctx) - snifferList := proxyman.ProtocoSniffersFromContext(ctx) + snifferList := proxyman.ProtocolSniffersFromContext(ctx) if destination.Address.Family().IsDomain() || len(snifferList) == 0 { go d.routedDispatch(ctx, outbound, destination) } else { @@ -110,7 +110,7 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, outbound ray.Out newError("taking detour [", tag, "] for [", destination, "]").WithContext(ctx).WriteToLog() dispatcher = handler } else { - newError("nonexisting tag: ", tag).AtWarning().WithContext(ctx).WriteToLog() + newError("non existing tag: ", tag).AtWarning().WithContext(ctx).WriteToLog() } } else { newError("default route for ", destination).WithContext(ctx).WriteToLog() diff --git a/app/proxyman/command/command.go b/app/proxyman/command/command.go index 023b83c5..ca0b662c 100644 --- a/app/proxyman/command/command.go +++ b/app/proxyman/command/command.go @@ -11,7 +11,7 @@ import ( // InboundOperation is the interface for operations that applies to inbound handlers. type InboundOperation interface { - // ApplyInbound appliess this operation to the given inbound handler. + // ApplyInbound applies this operation to the given inbound handler. ApplyInbound(context.Context, core.InboundHandler) error } diff --git a/app/proxyman/proxyman.go b/app/proxyman/proxyman.go index 1ae393aa..34bf481f 100644 --- a/app/proxyman/proxyman.go +++ b/app/proxyman/proxyman.go @@ -17,7 +17,7 @@ func ContextWithProtocolSniffers(ctx context.Context, list []KnownProtocols) con return context.WithValue(ctx, protocolsKey, list) } -func ProtocoSniffersFromContext(ctx context.Context) []KnownProtocols { +func ProtocolSniffersFromContext(ctx context.Context) []KnownProtocols { if list, ok := ctx.Value(protocolsKey).([]KnownProtocols); ok { return list } diff --git a/common/signal/done.go b/common/signal/done.go index ab365513..bedf50ab 100644 --- a/common/signal/done.go +++ b/common/signal/done.go @@ -38,7 +38,7 @@ func (d *Done) Wait() { <-d.c } -// Close marks this Done 'done'. This method may be called mutliple times. All calls after first call will have no effect on its status. +// Close marks this Done 'done'. This method may be called multiple times. All calls after first call will have no effect on its status. func (d *Done) Close() error { d.access.Lock() defer d.access.Unlock() diff --git a/common/signal/exec.go b/common/signal/exec.go index 3a3400f9..0547a607 100644 --- a/common/signal/exec.go +++ b/common/signal/exec.go @@ -12,7 +12,7 @@ func executeAndFulfill(f func() error, done chan<- error) { close(done) } -// ExecuteAsync executes a function asychrously and return its result. +// ExecuteAsync executes a function asynchronously and return its result. func ExecuteAsync(f func() error) <-chan error { done := make(chan error, 1) go executeAndFulfill(f, done) diff --git a/common/signal/notifier.go b/common/signal/notifier.go index 702bab06..0a036278 100644 --- a/common/signal/notifier.go +++ b/common/signal/notifier.go @@ -1,6 +1,6 @@ package signal -// Notifier is an utility for notifying changes. The change producer may notify changes multiple time, and the consumer may get notified asychronously. +// Notifier is an utility for notifying changes. The change producer may notify changes multiple time, and the consumer may get notified asynchronously. type Notifier struct { c chan struct{} } diff --git a/v2ray.go b/v2ray.go index f2c782ba..d6884216 100644 --- a/v2ray.go +++ b/v2ray.go @@ -130,7 +130,7 @@ func (s *Instance) Start() error { } // RegisterFeature registers the given feature into V2Ray. -// If feature is one of the following types, the corressponding feature in this Instance +// If feature is one of the following types, the corresponding feature in this Instance // will be replaced: DNSClient, PolicyManager, Router, Dispatcher, InboundHandlerManager, OutboundHandlerManager. func (s *Instance) RegisterFeature(feature interface{}, instance Feature) error { running := false