]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: add comments for transport gzip reader
authorAlexander Yastrebov <yastrebov.alex@gmail.com>
Sat, 6 Sep 2025 12:24:20 +0000 (12:24 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 15 Sep 2025 12:14:17 +0000 (05:14 -0700)
Add back comments dropped in CL 510255

Updates #61353

Change-Id: Ie84610b830599e178140bb5c2a11be74b2ad461e
GitHub-Last-Rev: d6cd890dd15aa0f2f8701cf66da11a844bbd011d
GitHub-Pull-Request: golang/go#75293
Reviewed-on: https://go-review.googlesource.com/c/go/+/701395
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

src/net/http/transport.go

index c5b1a87c5cb112cf4a0a79b5b4133e57fb20aea5..139ad84af0623a3392cdc2f592b2e0771d6ab0f6 100644 (file)
@@ -3046,8 +3046,8 @@ type gzipReader struct {
        _    incomparable
        body *bodyEOFSignal // underlying HTTP/1 response body framing
        mu   sync.Mutex     // guards zr and zerr
-       zr   *gzip.Reader
-       zerr error
+       zr   *gzip.Reader   // stores gzip reader from the pool between reads
+       zerr error          // sticky gzip reader init error or sentinel value to detect concurrent read and read after close
 }
 
 type eofReader struct{}