]> Cypherpunks repositories - gostls13.git/commit
net/http: fix early side effects in the ResponseWriter's ReadFrom
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 8 Aug 2013 21:02:54 +0000 (14:02 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 8 Aug 2013 21:02:54 +0000 (14:02 -0700)
commitde04bf24e5a9d4a52f0024dd684de21ec4a36340
treed15ddc0242e7bb820b3504783fe3baf14e2dc984
parent390656affd8993ce6332dca3fa86d57659622fdf
net/http: fix early side effects in the ResponseWriter's ReadFrom

The ResponseWriter's ReadFrom method was causing side effects on
the output before any data was read.

Now, bail out early and do a normal copy (which does a read
before writing) when our input and output are known to not to
be the pair of types we need for sendfile.

Fixes #5660

R=golang-dev, rsc, nightlyone
CC=golang-dev
https://golang.org/cl/12632043
src/pkg/net/http/serve_test.go
src/pkg/net/http/server.go