]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: use context.AfterFunc in handshakeContext
authordatabase64128 <free122448@hotmail.com>
Fri, 29 Aug 2025 09:52:54 +0000 (17:52 +0800)
committerSean Liao <sean@liao.dev>
Sat, 6 Sep 2025 09:20:36 +0000 (02:20 -0700)
commita6144613d3b601be1db6aa2fdaa79c954fdfe02c
treea32e088ae2df2218d82f695729eba4a23e5be192
parente8126bce9e511b92b914643d30f96846bbc5c783
crypto/tls: use context.AfterFunc in handshakeContext

This saves a goroutine when ctx can be canceled but is not canceled
during the handshakeContext call.

Use ctx consistently, because in this path (c.quic == nil) handshakeCtx
will only be canceled when ctx is canceled.

Change-Id: I7f4565119f30d589dce026b0d7ef3c324220525a
Reviewed-on: https://go-review.googlesource.com/c/go/+/699895
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/crypto/tls/conn.go