From: Andrew Gerrand Date: Mon, 17 Oct 2011 04:54:36 +0000 (+1100) Subject: http: fix panic when recovering from hijacked connection panic X-Git-Tag: weekly.2011-10-18~49 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=64471ae76204b116ab28c13f7008e90ae826a379;p=gostls13.git http: fix panic when recovering from hijacked connection panic Fixes #2375. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5279049 --- diff --git a/src/pkg/http/server.go b/src/pkg/http/server.go index 16071edec6..018be8cd3e 100644 --- a/src/pkg/http/server.go +++ b/src/pkg/http/server.go @@ -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)