]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: configure http2 transport only once
authorIngo Oeser <nightlyone@googlemail.com>
Tue, 11 Sep 2018 23:16:29 +0000 (01:16 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 26 Sep 2018 14:39:02 +0000 (14:39 +0000)
it looks like we should abort trying to configure the http2 transport
again, once it has been configured already.

Otherwise there will be no effect of these checks and changes, as they
will be overridden later again and the disable logic below will have no
effect, too.

So it really looks like we just forgot a return statement here.

Change-Id: Ic99b3bbc662a4e1e1bdbde77681bd1ae597255ad
Reviewed-on: https://go-review.googlesource.com/134795
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/transport.go

index ffe4cdc0d6dba647a25f487286a57836fa010785..b8788654b769a432094150dcc6731f8c1525e4b3 100644 (file)
@@ -286,6 +286,7 @@ func (t *Transport) onceSetNextProtoDefaults() {
                if v := rv.Field(0); v.CanInterface() {
                        if h2i, ok := v.Interface().(h2Transport); ok {
                                t.h2transport = h2i
+                               return
                        }
                }
        }