Commit 64471ae7 authored by Andrew Gerrand's avatar Andrew Gerrand

http: fix panic when recovering from hijacked connection panic

Fixes #2375.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5279049
parent edd1c911
......@@ -567,7 +567,9 @@ func (c *conn) serve() {
if err == nil {
return
}
c.rwc.Close()
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)
......
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