]> Cypherpunks repositories - gostls13.git/commit
net: fix race between Close and Read
authorDave Cheney <dave@cheney.net>
Sat, 21 Apr 2012 00:01:32 +0000 (10:01 +1000)
committerDave Cheney <dave@cheney.net>
Sat, 21 Apr 2012 00:01:32 +0000 (10:01 +1000)
commit1f14d45e7dc17d397e437e3bd9b507e5316e6ed6
treeebdc472493576cf3811c2b659ce54579589be0bd
parent904c7c8e9905c7ef7dfe817f8acb50a5f9fdd04b
net: fix race between Close and Read

Fixes #3507.

Applied the suggested fix from rsc. If the connection
is in closing state then errClosing will bubble up to
the caller.

The fix has been applied to udp, ip and unix as well as
their code path include nil'ing c.fd on close. Func
tests are available in the linked issue that verified
the bug existed there as well.

R=rsc, fullung, alex.brainman, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6002053
src/pkg/net/iprawsock_posix.go
src/pkg/net/tcpsock_posix.go
src/pkg/net/udpsock_posix.go
src/pkg/net/unixsock_posix.go