From f9c794c795a69e96d953a697b5f0d063b641d1dd Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Mon, 23 Apr 2018 16:42:37 +0200 Subject: [PATCH] fix lint errors --- app/proxyman/outbound/handler.go | 4 ++-- transport/pipe/impl.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/proxyman/outbound/handler.go b/app/proxyman/outbound/handler.go index b464fe6d..327ec16b 100644 --- a/app/proxyman/outbound/handler.go +++ b/app/proxyman/outbound/handler.go @@ -77,7 +77,7 @@ func (h *Handler) Tag() string { func (h *Handler) Dispatch(ctx context.Context, link *core.Link) { if h.mux != 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) } } 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() pipe.CloseError(link.Writer) } else { - common.Close(link.Writer) + common.Must(common.Close(link.Writer)) } pipe.CloseError(link.Reader) } diff --git a/transport/pipe/impl.go b/transport/pipe/impl.go index 7299f6c5..7aedb3d3 100644 --- a/transport/pipe/impl.go +++ b/transport/pipe/impl.go @@ -143,6 +143,8 @@ func (p *pipe) CloseError() { return } + p.state = errord + if !p.data.IsEmpty() { p.data.Release() p.data = nil