]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: split connErr to avoid read/write races.
authorAdam Langley <agl@golang.org>
Mon, 3 Mar 2014 14:01:44 +0000 (09:01 -0500)
committerAdam Langley <agl@golang.org>
Mon, 3 Mar 2014 14:01:44 +0000 (09:01 -0500)
commit3656c2db9639c524fe492ce74f485a35e0794cf4
treed9ae6888fc03813a5ad572f6e200455d8be2dfe6
parent8b1b1e159d0ff464062b5325edf29c52000fd1f4
crypto/tls: split connErr to avoid read/write races.

Currently a write error will cause future reads to return that same error.
However, there may have been extra information from a peer pending on
the read direction that is now unavailable.

This change splits the single connErr into errors for the read, write and
handshake. (Splitting off the handshake error is needed because both read
and write paths check the handshake error.)

Fixes #7414.

LGTM=bradfitz, r
R=golang-codereviews, r, bradfitz
CC=golang-codereviews
https://golang.org/cl/69090044
src/pkg/crypto/tls/conn.go
src/pkg/crypto/tls/handshake_client.go
src/pkg/crypto/tls/handshake_server.go