mirror of
https://github.com/golang/go
synced 2024-11-18 17:44:47 -07:00
http: fix panic when recovering from hijacked connection panic
Fixes #2375. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5279049
This commit is contained in:
parent
edd1c9111d
commit
64471ae762
@ -567,7 +567,9 @@ func (c *conn) serve() {
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
if c.rwc != nil { // may be nil if connection hijacked
|
||||
c.rwc.Close()
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
fmt.Fprintf(&buf, "http: panic serving %v: %v\n", c.remoteAddr, err)
|
||||
|
Loading…
Reference in New Issue
Block a user