mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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
This commit is contained in:
parent
f40e574d85
commit
13ea1fd233
7 changed files with 90 additions and 8 deletions
|
|
@ -862,7 +862,7 @@ var UnreadRuneErrorTests = []struct {
|
|||
name string
|
||||
f func(*Reader)
|
||||
}{
|
||||
{"Read", func(r *Reader) { r.Read([]byte{}) }},
|
||||
{"Read", func(r *Reader) { r.Read([]byte{0}) }},
|
||||
{"ReadByte", func(r *Reader) { r.ReadByte() }},
|
||||
{"UnreadRune", func(r *Reader) { r.UnreadRune() }},
|
||||
{"Seek", func(r *Reader) { r.Seek(0, 1) }},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue