commit | 69340ce214a7fd75be3cd139d5b98a50536fbd1c | [log] [tgz] |
---|---|---|
author | Damien Neil <dneil@google.com> | Mon Oct 04 14:43:09 2021 -0700 |
committer | Damien Neil <dneil@google.com> | Mon Oct 04 22:05:34 2021 +0000 |
tree | f78b9c34f3394e923bffc521a5aa6313328465c0 | |
parent | b30845b58a23336f67dcd6ae5e0a22c058ae2cb9 [diff] |
http2: avoid extra GetConn trace call CL 352469 inverts the case in shouldTraceGetConn: We want to call GetConn for connections that have been previously used, but it calls GetConn only on approximately the first use. "Approximately", because it uses cc.nextStreamID to determine if the connection has been used, which is racy. Restructure the decision to call GetConn to track a per-ClientConn bool indicating whether GetConn has already been called for this connection. Set this bool for connections received from net/http, clear it after the first use of the connection. Fixes net/http's TestTransportEventTrace_h2. Change-Id: I8e3dbba7cfbce9acd3612e39b6b6ee558bbfc864 Reviewed-on: https://go-review.googlesource.com/c/net/+/353875 Trust: Damien Neil <dneil@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This repository holds supplementary Go networking libraries.
The easiest way to install is to run go get -u golang.org/x/net
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/net
.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html. The main issue tracker for the net repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/net:” in the subject line, so it is easy to find.