diff options
author | Petar Maymounkov <petarm@gmail.com> | 2010-02-09 17:42:51 -0800 |
---|---|---|
committer | Petar Maymounkov <petarm@gmail.com> | 2010-02-09 17:42:51 -0800 |
commit | 4c6707de3ff6dc376215849135c4af10c52fec61 (patch) | |
tree | 583c017455d1e073f68a56a9085a3f9948d6b280 /src/pkg/http/request.go | |
parent | b07eb5f7acdf58ef956cf93dc0b3d73093eea738 (diff) | |
download | golang-4c6707de3ff6dc376215849135c4af10c52fec61.tar.gz |
http: protect io.WriteString in Request/Response.Write with error checking,
since they were causing a silent program exit (too many EPIPE's).
R=rsc
CC=golang-dev
http://codereview.appspot.com/204062
Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/pkg/http/request.go')
-rw-r--r-- | src/pkg/http/request.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pkg/http/request.go b/src/pkg/http/request.go index 17afc9cc1..bd8f00d55 100644 --- a/src/pkg/http/request.go +++ b/src/pkg/http/request.go @@ -171,7 +171,10 @@ func (req *Request) Write(w io.Writer) os.Error { // from Request, and introduce Request methods along the lines of // Response.{GetHeader,AddHeader} and string constants for "Host", // "User-Agent" and "Referer". - writeSortedKeyValue(w, req.Header, reqExcludeHeader) + err := writeSortedKeyValue(w, req.Header, reqExcludeHeader) + if err != nil { + return err + } io.WriteString(w, "\r\n") |