Skip to content

Commit

Permalink
Added Close to requestBodyProgress
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyRichter committed Jan 26, 2018
1 parent aa38b99 commit cb3adc5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pipeline/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ func (rbp *requestBodyProgress) Seek(offset int64, whence int) (offsetFromStart
return rbp.requestBody.Seek(offset, whence)
}

// requestBodyProgress supports Close but the underlying stream may not; if it does, Close will close it.
func (rbp *requestBodyProgress) Close() error {
if c, ok := rbp.requestBody.(io.Closer); ok {
return c.Close()
}
return nil
}

// ********** The following are specific to the response body (a ReadCloser)

// This struct is used when sending a body to the network
Expand Down

0 comments on commit cb3adc5

Please sign in to comment.