1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 10:08:15 -05:00

fix lint errors

This commit is contained in:
Darien Raymond 2018-04-23 16:42:37 +02:00
parent a0dc8d19fa
commit f9c794c795
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 4 additions and 2 deletions

View File

@ -77,7 +77,7 @@ func (h *Handler) Tag() string {
func (h *Handler) Dispatch(ctx context.Context, link *core.Link) { func (h *Handler) Dispatch(ctx context.Context, link *core.Link) {
if h.mux != nil { if h.mux != nil {
if err := h.mux.Dispatch(ctx, link); err != nil { if err := h.mux.Dispatch(ctx, link); err != nil {
newError("failed to process outbound traffic").Base(err).WithContext(ctx).WriteToLog() newError("failed to process mux outbound traffic").Base(err).WithContext(ctx).WriteToLog()
pipe.CloseError(link.Writer) pipe.CloseError(link.Writer)
} }
} else { } else {
@ -86,7 +86,7 @@ func (h *Handler) Dispatch(ctx context.Context, link *core.Link) {
newError("failed to process outbound traffic").Base(err).WithContext(ctx).WriteToLog() newError("failed to process outbound traffic").Base(err).WithContext(ctx).WriteToLog()
pipe.CloseError(link.Writer) pipe.CloseError(link.Writer)
} else { } else {
common.Close(link.Writer) common.Must(common.Close(link.Writer))
} }
pipe.CloseError(link.Reader) pipe.CloseError(link.Reader)
} }

View File

@ -143,6 +143,8 @@ func (p *pipe) CloseError() {
return return
} }
p.state = errord
if !p.data.IsEmpty() { if !p.data.IsEmpty() {
p.data.Release() p.data.Release()
p.data = nil p.data = nil