Commit 9ef22118 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

http2: fix CloseNotify data race

Fixes golang/go#17868

Change-Id: I7f9d85f404198d68757d7ca5bb8b1e7aafaafa8b
Reviewed-on: https://go-review.googlesource.com/33013
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarTom Bergan <tombergan@google.com>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 40d3034e
......@@ -2276,8 +2276,9 @@ func (w *responseWriter) CloseNotify() <-chan bool {
if ch == nil {
ch = make(chan bool, 1)
rws.closeNotifierCh = ch
cw := rws.stream.cw
go func() {
rws.stream.cw.Wait() // wait for close
cw.Wait() // wait for close
ch <- true
}()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment