Skip to content

Commit

Permalink
http2: remove ancient build-tagged files for unsupported Go versions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bradfitz authored and neild committed Nov 8, 2023
1 parent a720b30 commit cc6f4d1
Show file tree
Hide file tree
Showing 9 changed files with 183 additions and 306 deletions.
29 changes: 0 additions & 29 deletions http2/go111.go

This file was deleted.

26 changes: 0 additions & 26 deletions http2/go115.go

This file was deleted.

16 changes: 0 additions & 16 deletions http2/go118.go

This file was deleted.

20 changes: 0 additions & 20 deletions http2/not_go111.go

This file was deleted.

30 changes: 0 additions & 30 deletions http2/not_go115.go

This file was deleted.

16 changes: 0 additions & 16 deletions http2/not_go118.go

This file was deleted.

33 changes: 32 additions & 1 deletion http2/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ func (cc *ClientConn) forceCloseConn() {
if !ok {
return
}
if nc := tlsUnderlyingConn(tc); nc != nil {
if nc := tc.NetConn(); nc != nil {
nc.Close()
}
}
Expand Down Expand Up @@ -3201,3 +3201,34 @@ func traceFirstResponseByte(trace *httptrace.ClientTrace) {
trace.GotFirstResponseByte()
}
}

func traceHasWroteHeaderField(trace *httptrace.ClientTrace) bool {
return trace != nil && trace.WroteHeaderField != nil
}

func traceWroteHeaderField(trace *httptrace.ClientTrace, k, v string) {
if trace != nil && trace.WroteHeaderField != nil {
trace.WroteHeaderField(k, []string{v})
}
}

func traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error {
if trace != nil {
return trace.Got1xxResponse
}
return nil
}

// dialTLSWithContext uses tls.Dialer, added in Go 1.15, to open a TLS
// connection.
func (t *Transport) dialTLSWithContext(ctx context.Context, network, addr string, cfg *tls.Config) (*tls.Conn, error) {
dialer := &tls.Dialer{
Config: cfg,
}
cn, err := dialer.DialContext(ctx, network, addr)
if err != nil {
return nil, err
}
tlsCn := cn.(*tls.Conn) // DialContext comment promises this will always succeed
return tlsCn, nil
}
168 changes: 0 additions & 168 deletions http2/transport_go117_test.go

This file was deleted.

Loading

0 comments on commit cc6f4d1

Please sign in to comment.