Browse Source

fix lint errors

Darien Raymond 7 years ago
parent
commit
f9c794c795
2 changed files with 4 additions and 2 deletions
  1. 2 2
      app/proxyman/outbound/handler.go
  2. 2 0
      transport/pipe/impl.go

+ 2 - 2
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)
 	}

+ 2 - 0
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