summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/net/http2/pipe.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/net/http2/pipe.go')
-rw-r--r--vendor/golang.org/x/net/http2/pipe.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/golang.org/x/net/http2/pipe.go b/vendor/golang.org/x/net/http2/pipe.go
index 2a5399ec..c15b8a77 100644
--- a/vendor/golang.org/x/net/http2/pipe.go
+++ b/vendor/golang.org/x/net/http2/pipe.go
@@ -30,6 +30,17 @@ type pipeBuffer interface {
io.Reader
}
+// setBuffer initializes the pipe buffer.
+// It has no effect if the pipe is already closed.
+func (p *pipe) setBuffer(b pipeBuffer) {
+ p.mu.Lock()
+ defer p.mu.Unlock()
+ if p.err != nil || p.breakErr != nil {
+ return
+ }
+ p.b = b
+}
+
func (p *pipe) Len() int {
p.mu.Lock()
defer p.mu.Unlock()