diff --git a/app/proxyman/outbound/handler.go b/app/proxyman/outbound/handler.go index b464fe6d6..327ec16b4 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 7299f6c5e..7aedb3d3c 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