• Adam Langley's avatar
    crypto/tls: split connErr to avoid read/write races. · 3656c2db
    Adam Langley authored
    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
    3656c2db
conn.go 26.8 KB