Skip to content

Commit cc6f4d1

Browse files
bradfitzneild
authored andcommittedNov 8, 2023
http2: remove ancient build-tagged files for unsupported Go versions
x/net requires Go 1.18. No need to keep untested Go 1.11, Go 1.15, etc support around. Change-Id: I3588d273b543dec9ca120894ab36255f845abc20 Reviewed-on: https://go-review.googlesource.com/c/net/+/540236 Reviewed-by: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Christopher Taylor <ccmtaylor@gmail.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
·
v0.42.0v0.18.0
1 parent a720b30 commit cc6f4d1

File tree

9 files changed

+183
-306
lines changed

9 files changed

+183
-306
lines changed
 

‎http2/go111.go

Lines changed: 0 additions & 29 deletions
This file was deleted.

‎http2/go115.go

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎http2/go118.go

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎http2/not_go111.go

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎http2/not_go115.go

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎http2/not_go118.go

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎http2/transport.go

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ func (cc *ClientConn) forceCloseConn() {
10181018
if !ok {
10191019
return
10201020
}
1021-
if nc := tlsUnderlyingConn(tc); nc != nil {
1021+
if nc := tc.NetConn(); nc != nil {
10221022
nc.Close()
10231023
}
10241024
}
@@ -3201,3 +3201,34 @@ func traceFirstResponseByte(trace *httptrace.ClientTrace) {
32013201
trace.GotFirstResponseByte()
32023202
}
32033203
}
3204+
3205+
func traceHasWroteHeaderField(trace *httptrace.ClientTrace) bool {
3206+
return trace != nil && trace.WroteHeaderField != nil
3207+
}
3208+
3209+
func traceWroteHeaderField(trace *httptrace.ClientTrace, k, v string) {
3210+
if trace != nil && trace.WroteHeaderField != nil {
3211+
trace.WroteHeaderField(k, []string{v})
3212+
}
3213+
}
3214+
3215+
func traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error {
3216+
if trace != nil {
3217+
return trace.Got1xxResponse
3218+
}
3219+
return nil
3220+
}
3221+
3222+
// dialTLSWithContext uses tls.Dialer, added in Go 1.15, to open a TLS
3223+
// connection.
3224+
func (t *Transport) dialTLSWithContext(ctx context.Context, network, addr string, cfg *tls.Config) (*tls.Conn, error) {
3225+
dialer := &tls.Dialer{
3226+
Config: cfg,
3227+
}
3228+
cn, err := dialer.DialContext(ctx, network, addr)
3229+
if err != nil {
3230+
return nil, err
3231+
}
3232+
tlsCn := cn.(*tls.Conn) // DialContext comment promises this will always succeed
3233+
return tlsCn, nil
3234+
}

‎http2/transport_go117_test.go

Lines changed: 0 additions & 168 deletions
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.