]> Cypherpunks repositories - gostls13.git/commit
net/http, strings, bytes: fix http race, revert part of Reader behavior change
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 25 Apr 2014 13:44:51 +0000 (06:44 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 25 Apr 2014 13:44:51 +0000 (06:44 -0700)
commit13ea1fd233465bc5dd410c8c64c8120ab249ab69
treed1461cc38f872f439d2c2e65c51a4b44e994f82f
parentf40e574d85cd9bc492f62e7cbee8924a8a5e584e
net/http, strings, bytes: fix http race, revert part of Reader behavior change

I fixed this data race regression in two ways: in net/http itself, and also
partially reverting the change from https://golang.org/cl/77580046 .
Previously a Read from a strings.Reader or bytes.Reader returning 0 bytes
would not be a memory write. After 77580046 it was. This reverts that back
in case others depended on that. Also adds tests.

Fixes #7856

LGTM=ruiu, iant
R=iant, ruiu
CC=golang-codereviews, gri
https://golang.org/cl/94740044
src/pkg/bytes/reader.go
src/pkg/bytes/reader_test.go
src/pkg/net/http/serve_test.go
src/pkg/net/http/server.go
src/pkg/strings/reader.go
src/pkg/strings/reader_test.go
src/pkg/strings/strings_test.go