1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 01:12:24 +08:00

Merge pull request #2318 from rwcarlsen/fix-closenotify-panic2

fix another panic where CloseNotify was called from wrong goroutine
This commit is contained in:
Jeromy Johnson
2016-02-09 11:38:22 -08:00

View File

@ -114,9 +114,10 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request
defer cancel()
if cn, ok := w.(http.CloseNotifier); ok {
clientGone := cn.CloseNotify()
go func() {
select {
case <-cn.CloseNotify():
case <-clientGone:
case <-ctx.Done():
}
cancel()