• Filippo Valsorda's avatar
    crypto/tls: replace net.Pipe in tests with real TCP connections · be0f3c28
    Filippo Valsorda authored
    crypto/tls is meant to work over network connections with buffering, not
    synchronous connections, as explained in #24198. Tests based on net.Pipe
    are unrealistic as reads and writes are matched one to one. Such tests
    worked just thanks to the implementation details of the tls.Conn
    internal buffering, and would break if for example the flush of the
    first flight of the server was not entirely assimilated by the client
    rawInput buffer before the client attempted to reply to the ServerHello.
    
    Note that this might run into the Darwin network issues at #25696.
    
    Fixed a few test races that were either hidden or synchronized by the
    use of the in-memory net.Pipe.
    
    Also, this gets us slightly more realistic benchmarks, reflecting some
    syscall cost of Read and Write operations.
    
    Change-Id: I5a597b3d7a81b8ccc776030cc837133412bf50f8
    Reviewed-on: https://go-review.googlesource.com/c/142817
    Run-TryBot: Filippo Valsorda <filippo@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    be0f3c28
Name
Last commit
Last update
..
aes Loading commit data...
cipher Loading commit data...
des Loading commit data...
dsa Loading commit data...
ecdsa Loading commit data...
elliptic Loading commit data...
hmac Loading commit data...
internal Loading commit data...
md5 Loading commit data...
rand Loading commit data...
rc4 Loading commit data...
rsa Loading commit data...
sha1 Loading commit data...
sha256 Loading commit data...
sha512 Loading commit data...
subtle Loading commit data...
tls Loading commit data...
x509 Loading commit data...
crypto.go Loading commit data...
issue21104_test.go Loading commit data...