]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: fix data race on conn.err
authorDave Cheney <dave@cheney.net>
Thu, 6 Sep 2012 07:50:26 +0000 (17:50 +1000)
committerDave Cheney <dave@cheney.net>
Thu, 6 Sep 2012 07:50:26 +0000 (17:50 +1000)
commit67ee9a7db103b5ae5c8d077fef9e21cf6f137f3a
tree35d525fe9ea36f5818cf97048d0a6fd438f81818
parentef05d8688f1ea1952d87cdea37d0848629dcb13b
crypto/tls: fix data race on conn.err

Fixes #3862.

There were many areas where conn.err was being accessed
outside the mutex. This proposal moves the err value to
an embedded struct to make it more obvious when the error
value is being accessed.

As there are no Benchmark tests in this package I cannot
feel confident of the impact of this additional locking,
although most will be uncontended.

R=dvyukov, agl
CC=golang-dev
https://golang.org/cl/6497070
src/pkg/crypto/tls/conn.go
src/pkg/crypto/tls/handshake_client.go