mirror of
https://github.com/golang/go
synced 2024-11-22 03:14:41 -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 {
|
if err == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.rwc.Close()
|
if c.rwc != nil { // may be nil if connection hijacked
|
||||||
|
c.rwc.Close()
|
||||||
|
}
|
||||||
|
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
fmt.Fprintf(&buf, "http: panic serving %v: %v\n", c.remoteAddr, err)
|
fmt.Fprintf(&buf, "http: panic serving %v: %v\n", c.remoteAddr, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user