Commit 4c02c982 authored by Jeromy Johnson's avatar Jeromy Johnson

Merge pull request #2315 from rwcarlsen/fix-closenotify-panic

fix go1.6rc2 panic where closenotify was called from wrong goroutine
parents e9cc395e ed23d99d
......@@ -138,9 +138,10 @@ func (i internalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ctx, cancel := context.WithCancel(node.Context())
defer cancel()
if cn, ok := w.(http.CloseNotifier); ok {
clientGone := cn.CloseNotify()
go func() {
select {
case <-cn.CloseNotify():
case <-clientGone:
case <-ctx.Done():
}
cancel()
......
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