Skip to content

Commit

Permalink
net/http: never ever cancel r.Context() after Hijack
Browse files Browse the repository at this point in the history
  • Loading branch information
nhooyr committed May 29, 2019
1 parent ee59c06 commit ba7fc7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/net/http/server.go
Expand Up @@ -742,6 +742,10 @@ func (cr *connReader) hitReadLimit() bool { return cr.remain <= 0 }
//
// It may be called from multiple goroutines.
func (cr *connReader) handleReadError(_ error) {
if cr.conn.hijacked() {
// https://github.com/golang/go/issues/32314
return
}
cr.conn.cancelCtx()
cr.closeNotify()
}
Expand Down

0 comments on commit ba7fc7e

Please sign in to comment.