Skip to content

Commit

Permalink
http2: fix CloseNotify data race
Browse files Browse the repository at this point in the history
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: Tom Bergan <tombergan@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
bradfitz committed Nov 9, 2016
1 parent 1a2b0e7 commit 5de77f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}()
}
Expand Down

0 comments on commit 5de77f9

Please sign in to comment.