]> Cypherpunks.ru repositories - gostls13.git/commit
crypto/tls: replace errClosed with net.ErrClosed
authorAinar Garipov <gugl.zadolbal@gmail.com>
Wed, 23 Sep 2020 18:15:01 +0000 (21:15 +0300)
committerKatie Hockman <katie@golang.org>
Thu, 24 Sep 2020 15:48:24 +0000 (15:48 +0000)
commit8e8bfb697fbc948494d67428c4953605cc89b6f4
tree701d3adac1da2bf73b4f9eb5e56dca373dd1bd0c
parent9e073b504fbb936f54e6be50a41903319a993ce9
crypto/tls: replace errClosed with net.ErrClosed

CL 250357 exported net.ErrClosed to allow more reliable detection
of closed network connection errors.  Use that error in crypto/tls
as well.

The error message is changed from "tls: use of closed connection"
to "use of closed network connection", so the code that detected such
errors by looking for that text in the error message will need to be
updated to use errors.Is(err, net.ErrClosed) instead.

Fixes #41066

Change-Id: Ic05c0ed6a4f57af2a0302d53b00851a59200be2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/256897
Reviewed-by: Katie Hockman <katie@golang.org>
Trust: Katie Hockman <katie@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
src/crypto/tls/conn.go
src/crypto/tls/tls_test.go