Skip to content

Commit

Permalink
Appease linter
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Jul 26, 2023
1 parent dce9fe1 commit 2058dec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/caddyhttp/encode/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ func (rw *responseWriter) Flush() {
// to rw.Write (see bug in #4314)
return
}
//nolint:bodyclose
http.NewResponseController(rw).Flush()
}

Expand All @@ -219,6 +220,7 @@ func (rw *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
}
rw.wroteHeader = true
}
//nolint:bodyclose
return http.NewResponseController(rw).Hijack()
}

Expand Down
1 change: 1 addition & 0 deletions modules/caddyhttp/responsewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ func (rr *responseRecorder) WriteResponse() error {
}

func (rr *responseRecorder) Hijack() (net.Conn, *bufio.ReadWriter, error) {
//nolint:bodyclose
conn, brw, err := http.NewResponseController(rr.ResponseWriterWrapper).Hijack()
if err != nil {
return nil, nil, err
Expand Down
2 changes: 2 additions & 0 deletions modules/caddyhttp/reverseproxy/streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ func (m *maxLatencyWriter) Write(p []byte) (n int, err error) {
defer m.mu.Unlock()
n, err = m.dst.Write(p)
if m.latency < 0 {
//nolint:errcheck
m.flush()
return
}
Expand All @@ -477,6 +478,7 @@ func (m *maxLatencyWriter) delayedFlush() {
if !m.flushPending { // if stop was called but AfterFunc already started this goroutine
return
}
//nolint:errcheck
m.flush()
m.flushPending = false
}
Expand Down

0 comments on commit 2058dec

Please sign in to comment.