Descriptionnet/http: fix TimeoutHandler data races; hold lock longer
The existing lock needed to be held longer. If a timeout occured
while writing (but after the guarded timeout check), the writes
would clobber a future connection's buffer.
Also remove a harmless warning by making Write also set the
flag that headers were sent (implicitly), so we don't try to
write headers later (a no-op + warning) on timeout after we've
started writing.
Fixes Issue 8414
Fixes Issue 8209
Patch Set 1 #Patch Set 2 : diff -r 3cf190969915d6d531acd0795eb81974aaa64d19 https://go.googlecode.com/hg/ #Patch Set 3 : diff -r 3cf190969915d6d531acd0795eb81974aaa64d19 https://go.googlecode.com/hg/ #Patch Set 4 : diff -r 3cf190969915d6d531acd0795eb81974aaa64d19 https://go.googlecode.com/hg/ #
Total comments: 1
Patch Set 5 : diff -r 3cf190969915d6d531acd0795eb81974aaa64d19 https://go.googlecode.com/hg/ #Patch Set 6 : diff -r 7e00313f3b3a14e59d607aaab84416289dbc76f6 https://go.googlecode.com/hg/ #MessagesTotal messages: 10
|