TUN-5405: Update net package to v0.0.0-20211109214657-ef0fda0de508

This version contains fix to https://github.com/golang/go/issues/43989
This commit is contained in:
cthuang
2021-11-10 17:20:10 +00:00
parent 794635fb54
commit 7024d193c9
28 changed files with 1679 additions and 982 deletions

View File

@@ -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()